org.xerial.snappy
Class SnappyCodec

java.lang.Object
  extended by org.xerial.snappy.SnappyCodec

public class SnappyCodec
extends Object

Preamble header for SnappyOutputStream.

The magic header is the following 8 bytes data:

 -126, 'S', 'N', 'A', 'P', 'P', 'Y', 0
 

Author:
leo

Field Summary
 int compatibleVersion
           
static int DEFAULT_VERSION
           
 byte[] magic
           
static byte[] MAGIC_HEADER
           
static int MAGIC_LEN
           
static int MINIMUM_COMPATIBLE_VERSION
           
 int version
           
 
Method Summary
static SnappyCodec currentHeader()
           
static int headerSize()
           
 boolean isValidMagicHeader()
           
static SnappyCodec readHeader(InputStream in)
           
 String toString()
           
 void writeHeader(OutputStream out)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

MAGIC_HEADER

public static final byte[] MAGIC_HEADER

MAGIC_LEN

public static final int MAGIC_LEN
See Also:
Constant Field Values

DEFAULT_VERSION

public static final int DEFAULT_VERSION
See Also:
Constant Field Values

MINIMUM_COMPATIBLE_VERSION

public static final int MINIMUM_COMPATIBLE_VERSION
See Also:
Constant Field Values

magic

public final byte[] magic

version

public final int version

compatibleVersion

public final int compatibleVersion
Method Detail

toString

public String toString()
Overrides:
toString in class Object

headerSize

public static int headerSize()

writeHeader

public void writeHeader(OutputStream out)
                 throws IOException
Throws:
IOException

isValidMagicHeader

public boolean isValidMagicHeader()

readHeader

public static SnappyCodec readHeader(InputStream in)
                              throws IOException
Throws:
IOException

currentHeader

public static SnappyCodec currentHeader()


Copyright © 2011 xerial.org. All Rights Reserved.