congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
com.ning.compress.lzf.parallel
Code IndexAdd Tabnine to your IDE (free)

How to use com.ning.compress.lzf.parallel

Best Java code snippets using com.ning.compress.lzf.parallel (Showing top 20 results out of 315)

origin: com.ning/compress-lzf

/**
 * This <code>flush</code> method does nothing.
 */
@Override
public void flush() throws IOException
{
  checkNotClosed();
}
origin: ning/compress

/**
 * {@inheritDoc}
 * WARNING: using this method will lead to very poor performance!
 */
@Override
public void write(final int singleByte) throws IOException
{
  checkNotClosed();
  if (_position >= _outputBuffer.length) {
    writeCompressedBlock();
  }
  _outputBuffer[_position++] = (byte) singleByte;
}
origin: ning/compress

public PLZFOutputStream(final OutputStream outputStream) {
  this(outputStream, DEFAULT_OUTPUT_BUFFER_SIZE, getNThreads());
}
origin: com.ning/compress-lzf

/**
 * Compress and write the current block to the OutputStream
 */
protected void writeCompressedBlock() throws IOException
{
  if (_position == 0) {
    return;
  }
  Future<LZFChunk> lzfFuture = compressExecutor.submit(new CompressTask(_outputBuffer, 0, _position, blockManager));
  writeExecutor.execute(new WriteTask(out, lzfFuture, this));
  _outputBuffer = blockManager.getBlockFromPool();
  _position = 0;
  checkWriteException();
}
origin: com.ning/compress-lzf

public void write(final InputStream in) throws IOException {
  writeCompressedBlock(); // will flush _outputBuffer
  int read;
  while ((read = in.read(_outputBuffer)) >= 0) {
    _position = read;
    writeCompressedBlock();
  }
}
origin: ning/compress

public void write(final FileChannel in) throws IOException {
  MappedByteBuffer src = in.map(MapMode.READ_ONLY, 0, in.size());
  write(src);
}
origin: com.ning/compress-lzf

/** {@inheritDoc} */
@Override
public LZFChunk call() {
  if (data != null) {
    LZFChunk lzfChunk = ENCODER.get().encodeChunk(data, offset, length);
    // input data is fully processed, we can now discard it
    blockManager.releaseBlockToPool(data);
    return lzfChunk;
  } else {
    // cleanup time!
    ENCODER.remove();
    return null;
  }
}
origin: ning/compress

/**
 * Compress and write the current block to the OutputStream
 */
protected void writeCompressedBlock() throws IOException
{
  if (_position == 0) {
    return;
  }
  Future<LZFChunk> lzfFuture = compressExecutor.submit(new CompressTask(_outputBuffer, 0, _position, blockManager));
  writeExecutor.execute(new WriteTask(out, lzfFuture, this));
  _outputBuffer = blockManager.getBlockFromPool();
  _position = 0;
  checkWriteException();
}
origin: com.ning/compress-lzf

/**
 * {@inheritDoc}
 * WARNING: using this method will lead to very poor performance!
 */
@Override
public void write(final int singleByte) throws IOException
{
  checkNotClosed();
  if (_position >= _outputBuffer.length) {
    writeCompressedBlock();
  }
  _outputBuffer[_position++] = (byte) singleByte;
}
origin: ning/compress

/**
 * This <code>flush</code> method does nothing.
 */
@Override
public void flush() throws IOException
{
  checkNotClosed();
}
origin: harbby/presto-connectors

public PLZFOutputStream(final OutputStream outputStream) {
  this(outputStream, DEFAULT_OUTPUT_BUFFER_SIZE, getNThreads());
}
origin: harbby/presto-connectors

public void write(final InputStream in) throws IOException {
  writeCompressedBlock(); // will flush _outputBuffer
  int read;
  while ((read = in.read(_outputBuffer)) >= 0) {
    _position = read;
    writeCompressedBlock();
  }
}
origin: com.ning/compress-lzf

public void write(final FileChannel in) throws IOException {
  MappedByteBuffer src = in.map(MapMode.READ_ONLY, 0, in.size());
  write(src);
}
origin: ning/compress

/** {@inheritDoc} */
@Override
public LZFChunk call() {
  if (data != null) {
    LZFChunk lzfChunk = ENCODER.get().encodeChunk(data, offset, length);
    // input data is fully processed, we can now discard it
    blockManager.releaseBlockToPool(data);
    return lzfChunk;
  } else {
    // cleanup time!
    ENCODER.remove();
    return null;
  }
}
origin: harbby/presto-connectors

/**
 * Compress and write the current block to the OutputStream
 */
protected void writeCompressedBlock() throws IOException
{
  if (_position == 0) {
    return;
  }
  Future<LZFChunk> lzfFuture = compressExecutor.submit(new CompressTask(_outputBuffer, 0, _position, blockManager));
  writeExecutor.execute(new WriteTask(out, lzfFuture, this));
  _outputBuffer = blockManager.getBlockFromPool();
  _position = 0;
  checkWriteException();
}
origin: harbby/presto-connectors

/**
 * {@inheritDoc}
 * WARNING: using this method will lead to very poor performance!
 */
@Override
public void write(final int singleByte) throws IOException
{
  checkNotClosed();
  if (_position >= _outputBuffer.length) {
    writeCompressedBlock();
  }
  _outputBuffer[_position++] = (byte) singleByte;
}
origin: harbby/presto-connectors

/**
 * This <code>flush</code> method does nothing.
 */
@Override
public void flush() throws IOException
{
  checkNotClosed();
}
origin: com.ning/compress-lzf

public PLZFOutputStream(final OutputStream outputStream) {
  this(outputStream, DEFAULT_OUTPUT_BUFFER_SIZE, getNThreads());
}
origin: ning/compress

public void write(final InputStream in) throws IOException {
  writeCompressedBlock(); // will flush _outputBuffer
  int read;
  while ((read = in.read(_outputBuffer)) >= 0) {
    _position = read;
    writeCompressedBlock();
  }
}
origin: harbby/presto-connectors

public void write(final FileChannel in) throws IOException {
  MappedByteBuffer src = in.map(MapMode.READ_ONLY, 0, in.size());
  write(src);
}
com.ning.compress.lzf.parallel

Most used classes

  • BlockManager
  • CompressTask
  • PLZFOutputStream
    Decorator OutputStream implementation that will compress output using LZF compression algorithm, giv
  • WriteTask
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now