org.apache.hadoop.io.compress
Class LzopCodec.LzopOutputStream

java.lang.Object
  extended by java.io.OutputStream
      extended by org.apache.hadoop.io.compress.CompressionOutputStream
          extended by org.apache.hadoop.io.compress.LzopCodec.LzopOutputStream
All Implemented Interfaces:
Closeable, Flushable
Enclosing class:
LzopCodec

protected static class LzopCodec.LzopOutputStream
extends CompressionOutputStream


Field Summary
 
Fields inherited from class org.apache.hadoop.io.compress.CompressionOutputStream
out
 
Constructor Summary
LzopCodec.LzopOutputStream(OutputStream out, Compressor compressor, int bufferSize, LzoCompressor.CompressionStrategy strategy)
           
 
Method Summary
 void close()
          Close the underlying stream and write a null word to the output stream.
 void finish()
          Finishes writing compressed data to the output stream without closing the underlying stream.
 void resetState()
          Reset the compression to the initial state.
 void write(byte[] b, int off, int len)
          Write the data provided to the compression codec, compressing no more than the buffer size less the compression overhead as specified during construction for each block.
 void write(int b)
           
protected static void writeLzopHeader(OutputStream out, LzoCompressor.CompressionStrategy strategy)
          Write an lzop-compatible header to the OutputStream provided.
 
Methods inherited from class org.apache.hadoop.io.compress.CompressionOutputStream
flush
 
Methods inherited from class java.io.OutputStream
write
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LzopCodec.LzopOutputStream

public LzopCodec.LzopOutputStream(OutputStream out,
                                  Compressor compressor,
                                  int bufferSize,
                                  LzoCompressor.CompressionStrategy strategy)
                           throws IOException
Throws:
IOException
Method Detail

writeLzopHeader

protected static void writeLzopHeader(OutputStream out,
                                      LzoCompressor.CompressionStrategy strategy)
                               throws IOException
Write an lzop-compatible header to the OutputStream provided.

Throws:
IOException

close

public void close()
           throws IOException
Close the underlying stream and write a null word to the output stream.

Specified by:
close in interface Closeable
Throws:
IOException

write

public void write(byte[] b,
                  int off,
                  int len)
           throws IOException
Write the data provided to the compression codec, compressing no more than the buffer size less the compression overhead as specified during construction for each block. Each block contains the uncompressed length for the block, followed by one or more length-prefixed blocks of compressed data.

Throws:
IOException

finish

public void finish()
            throws IOException
Description copied from class: CompressionOutputStream
Finishes writing compressed data to the output stream without closing the underlying stream.

Throws:
IOException

resetState

public void resetState()
                throws IOException
Description copied from class: CompressionOutputStream
Reset the compression to the initial state. Does not reset the underlying stream.

Specified by:
resetState in class CompressionOutputStream
Throws:
IOException

write

public void write(int b)
           throws IOException
Specified by:
write in class OutputStream
Throws:
IOException


Copyright © 2008 The Apache Software Foundation