Codota Logo
CodecFileBuffer
Code IndexAdd Codota to your IDE (free)

How to use
CodecFileBuffer
in
de.huxhorn.sulky.codec.filebuffer

Best Java code snippets using de.huxhorn.sulky.codec.filebuffer.CodecFileBuffer (Showing top 19 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
OutputStreamWriter o =
  • Codota IconOutputStream out;new OutputStreamWriter(out)
  • Codota IconOutputStream out;String charsetName;new OutputStreamWriter(out, charsetName)
  • Codota IconHttpURLConnection connection;new OutputStreamWriter(connection.getOutputStream())
  • Smart code suggestions by Codota
}
origin: de.huxhorn.sulky/de.huxhorn.sulky.codec.filebuffer

@Override
public void addAll(E[] elements)
{
  addAll(Arrays.asList(elements));
}
origin: de.huxhorn.sulky/de.huxhorn.sulky.codec.filebuffer

private void setIndexFile(File indexFile)
{
  prepareFile(indexFile);
  this.indexFile = indexFile;
}
origin: de.huxhorn.lilith/de.huxhorn.lilith.engine

public FileBuffer<EventWrapper<T>> createBuffer(File dataFile, File indexFile, Map<String, String> usedMetaData)
{
  if(logger.isInfoEnabled()) logger.info("Creating buffer for dataFile '{}'.", dataFile.getAbsolutePath());
  CodecFileBuffer<EventWrapper<T>> result = new CodecFileBuffer<>(magicValue, false, usedMetaData, null, dataFile, indexFile);
  FileHeader fileHeader = result.getFileHeader();
  MetaData actualMetaData = fileHeader.getMetaData();
  result.setCodec(resolveCodec(actualMetaData));
  if(logger.isDebugEnabled()) logger.debug("Created file buffer: {}", result);
  return result;
}
origin: de.huxhorn.sulky/de.huxhorn.sulky.codec.filebuffer

setDataFile(dataFile);
setIndexFile(indexFile);
if(!initFilesIfNecessary())
  validateHeader();
origin: de.huxhorn.sulky/de.huxhorn.sulky.codec.filebuffer

@Override
public boolean set(long index, E element)
  initFilesIfNecessary();
origin: huxi/sulky

setFileHeader(fileHeaderStrategy.writeFileHeader(dataFile, magicValue, preferredMetaData, preferredSparse));
indexDeleted=indexFile.delete();
origin: huxi/sulky

setDataFile(dataFile);
setIndexFile(indexFile);
if(!initFilesIfNecessary())
  validateHeader();
origin: huxi/sulky

initFilesIfNecessary();
int newElementCount = elements.size();
if(newElementCount > 0)
origin: de.huxhorn.sulky/de.huxhorn.sulky.codec.filebuffer

setFileHeader(fileHeaderStrategy.writeFileHeader(dataFile, magicValue, preferredMetaData, preferredSparse));
indexDeleted=indexFile.delete();
origin: huxi/sulky

@Override
public boolean set(long index, E element)
  initFilesIfNecessary();
origin: huxi/sulky

private void setIndexFile(File indexFile)
{
  prepareFile(indexFile);
  this.indexFile = indexFile;
}
origin: huxi/sulky

setFileHeader(header);
origin: huxi/sulky

@Override
public void addAll(E[] elements)
{
  addAll(Arrays.asList(elements));
}
origin: huxi/sulky

public void add(E element)
  initFilesIfNecessary();
origin: huxi/sulky

private void setDataFile(File dataFile)
{
  prepareFile(dataFile);
  this.dataFile = dataFile;
}
origin: de.huxhorn.sulky/de.huxhorn.sulky.codec.filebuffer

setFileHeader(header);
origin: de.huxhorn.sulky/de.huxhorn.sulky.codec.filebuffer

public void add(E element)
  initFilesIfNecessary();
origin: de.huxhorn.sulky/de.huxhorn.sulky.codec.filebuffer

private void setDataFile(File dataFile)
{
  prepareFile(dataFile);
  this.dataFile = dataFile;
}
origin: de.huxhorn.sulky/de.huxhorn.sulky.codec.filebuffer

initFilesIfNecessary();
int newElementCount = elements.size();
if(newElementCount > 0)
de.huxhorn.sulky.codec.filebufferCodecFileBuffer

Javadoc

In contrast to SerializingFileBuffer, this implementation supports the following:
  • An optional magic value to identify the type of a buffer file. If present (and it should be), it is contained in the first four bytes of the data-file and can be evaluated by external classes, e.g. FileFilters. An application would use one (or more) specific magic value to identify it's own files.
  • Configurable Codec so the way the elements are actually written and read can be changed as needed.
  • Optional meta data that can be used to provide additional information about the content of the buffer. It might be used to identify the correct Codec required by the buffer
  • Optional ElementProcessors that are executed after elements are added to the buffer.
TODO: more documentation :p

Most used methods

  • addAll
  • initFilesIfNecessary
  • prepareFile
  • setDataFile
  • setFileHeader
  • setIndexFile
  • validateHeader
  • <init>
  • getFileHeader
  • setCodec

Popular in Java

  • Creating JSON documents from java classes using gson
  • onCreateOptionsMenu (Activity)
  • getSharedPreferences (Context)
  • findViewById (Activity)
  • Table (com.google.common.collect)
    A collection that associates an ordered pair of keys, called a row key and a column key, with a sing
  • ServerSocket (java.net)
    This class represents a server-side socket that waits for incoming client connections. A ServerSocke
  • URL (java.net)
    A Uniform Resource Locator that identifies the location of an Internet resource as specified by RFC
  • SortedSet (java.util)
    A Set that further provides a total ordering on its elements. The elements are ordered using their C
  • Handler (java.util.logging)
    A Handler object accepts a logging request and exports the desired messages to a target, for example
  • Loader (org.hibernate.loader)
    Abstract superclass of object loading (and querying) strategies. This class implements useful common
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now