org.xerial.snappy.SnappyFramedOutputStream Java Examples

The following examples show how to use org.xerial.snappy.SnappyFramedOutputStream. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: CompressionStreamAdaptor.java    From galaxy-sdk-java with Apache License 2.0 5 votes vote down vote up
public static OutputStream getOutputStream(OutputStream outputStream, Compression compression)
    throws IOException {
  if (compression != null) {
    switch (compression) {
    case SNAPPY:
      return new SnappyFramedOutputStream(outputStream);
    case NONE:
      return outputStream;
    default:
      throw new IllegalArgumentException("Unsupported compression codec: " + compression);
    }
  }
  return outputStream;
}
 
Example #2
Source File: SnappyFramedCodec.java    From kangaroo with Apache License 2.0 5 votes vote down vote up
/**
 * {@inheritDoc}
 */
@Override
public CompressionOutputStream createOutputStream(final OutputStream out, final Compressor compressor)
        throws IOException {
    LOG.info("Creating compressor stream");
    return new OStreamDelegatingCompressorStream(new SnappyFramedOutputStream(out, conf.getInt(
            COMPRESSION_BLOCK_SIZE_CONF, SnappyFramedOutputStream.DEFAULT_BLOCK_SIZE),
            SnappyFramedOutputStream.DEFAULT_MIN_COMPRESSION_RATIO));
}
 
Example #3
Source File: SnappyStreamCompressionDecorator.java    From Flink-CEPplus with Apache License 2.0 4 votes vote down vote up
@Override
protected OutputStream decorateWithCompression(NonClosingOutpusStreamDecorator stream) throws IOException {
	return new SnappyFramedOutputStream(stream, COMPRESSION_BLOCK_SIZE, MIN_COMPRESSION_RATIO);
}
 
Example #4
Source File: SnappyStreamCompressionDecorator.java    From flink with Apache License 2.0 4 votes vote down vote up
@Override
protected OutputStream decorateWithCompression(NonClosingOutpusStreamDecorator stream) throws IOException {
	return new SnappyFramedOutputStream(stream, COMPRESSION_BLOCK_SIZE, MIN_COMPRESSION_RATIO);
}
 
Example #5
Source File: SnappyStreamCompressionDecorator.java    From flink with Apache License 2.0 4 votes vote down vote up
@Override
protected OutputStream decorateWithCompression(NonClosingOutpusStreamDecorator stream) throws IOException {
	return new SnappyFramedOutputStream(stream, COMPRESSION_BLOCK_SIZE, MIN_COMPRESSION_RATIO);
}