org.xerial.snappy
クラス SnappyOutputStream

java.lang.Object
  上位を拡張 java.io.OutputStream
      上位を拡張 org.xerial.snappy.SnappyOutputStream
すべての実装されたインタフェース:
Closeable, Flushable

public class SnappyOutputStream
extends OutputStream

This class implements a stream filter for writing compressed data using Snappy. The input data is blocked into 32kb size (in default), and each block is compressed and then passed to the given OutputStream. The output data format is:

  1. snappy codec header defined in SnappyCodec
  2. a pair of (compressed data size, compressed data...)
  3. a pair of (compressed data size, compressed data...)
  4. ...
Note that the compressed data created by SnappyOutputStream cannot be uncompressed by Snappy.uncompress(byte[]) since the output formats of Snappy.compress(byte[]) and SnappyOutputStream are different. Use SnappyInputStream for uncompress the data generated by SnappyOutputStream.

作成者:
leo

フィールドの概要
protected  byte[] compressed
           
protected  OutputStream out
           
protected  byte[] uncompressed
           
 
コンストラクタの概要
SnappyOutputStream(OutputStream out)
           
SnappyOutputStream(OutputStream out, int blockSize)
           
 
メソッドの概要
 void close()
           
protected  void dump()
           
 void flush()
           
 void rawWrite(Object array, int byteOffset, int byteLength)
          Compress the raw byte array data.
 void write(byte[] b, int off, int len)
           
 void write(double[] f)
           
 void write(double[] f, int off, int len)
           
 void write(float[] f)
           
 void write(float[] f, int off, int len)
           
 void write(int b)
           
 void write(int[] f)
           
 void write(int[] f, int off, int len)
           
 void write(long[] d)
           
 void write(long[] d, int off, int len)
          Compress the input long array data
 void write(short[] f)
           
 void write(short[] f, int off, int len)
           
protected  void writeHeader()
           
 
クラス java.io.OutputStream から継承されたメソッド
write
 
クラス java.lang.Object から継承されたメソッド
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

フィールドの詳細

out

protected final OutputStream out

uncompressed

protected byte[] uncompressed

compressed

protected byte[] compressed
コンストラクタの詳細

SnappyOutputStream

public SnappyOutputStream(OutputStream out)
                   throws IOException
例外:
IOException

SnappyOutputStream

public SnappyOutputStream(OutputStream out,
                          int blockSize)
                   throws IOException
例外:
IOException
メソッドの詳細

writeHeader

protected void writeHeader()
                    throws IOException
例外:
IOException

write

public void write(byte[] b,
                  int off,
                  int len)
           throws IOException
オーバーライド:
クラス OutputStream 内の write
例外:
IOException

write

public void write(long[] d,
                  int off,
                  int len)
           throws IOException
Compress the input long array data

パラメータ:
d - input array
off - offset in the array
len - the number of elements in the array to copy
例外:
IOException

write

public void write(double[] f,
                  int off,
                  int len)
           throws IOException
例外:
IOException

write

public void write(float[] f,
                  int off,
                  int len)
           throws IOException
例外:
IOException

write

public void write(int[] f,
                  int off,
                  int len)
           throws IOException
例外:
IOException

write

public void write(short[] f,
                  int off,
                  int len)
           throws IOException
例外:
IOException

write

public void write(long[] d)
           throws IOException
例外:
IOException

write

public void write(double[] f)
           throws IOException
例外:
IOException

write

public void write(float[] f)
           throws IOException
例外:
IOException

write

public void write(int[] f)
           throws IOException
例外:
IOException

write

public void write(short[] f)
           throws IOException
例外:
IOException

rawWrite

public void rawWrite(Object array,
                     int byteOffset,
                     int byteLength)
              throws IOException
Compress the raw byte array data.

パラメータ:
array - array data of any type (e.g., byte[], float[], long[], ...)
byteOffset -
byteLength -
例外:
IOException

write

public void write(int b)
           throws IOException
定義:
クラス OutputStream 内の write
例外:
IOException

flush

public void flush()
           throws IOException
定義:
インタフェース Flushable 内の flush
オーバーライド:
クラス OutputStream 内の flush
例外:
IOException

dump

protected void dump()
             throws IOException
例外:
IOException

close

public void close()
           throws IOException
定義:
インタフェース Closeable 内の close
オーバーライド:
クラス OutputStream 内の close
例外:
IOException


Copyright © 2011. All Rights Reserved.