|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.spinn3r.api.util.CompressedBLOB
public class CompressedBLOB
Facade which allows us to compress and decompress text easily and efficiently from a central location with the correctly library and encodign support.
| Field Summary | |
|---|---|
protected byte[] |
b
compressed form of this content. |
static int |
BUFFER_SIZE
|
static int |
COMPRESSION_RATIO
|
protected java.lang.String |
content
The internal content... |
static int |
DECOMPRESSION_RATIO
|
static int |
DEFAULT_LEVEL
Specify the default compression level. |
static boolean |
ENABLE_CACHED_BYTES
|
static java.lang.String |
ENCODING
Specifies the type of string encoding to use regardless of whether it's compressed or not. |
protected int |
external_format
Specify the default external format used for this content. |
static int |
EXTERNAL_FORMAT
Specifies the default external format to use for new compressed data. |
static int |
FORMAT_BASE64_ZLIB
|
static int |
FORMAT_UNKNOWN
|
static int |
FORMAT_UTF8
|
static int |
FORMAT_ZLIB
UTF+ZLIB compression. |
protected java.lang.String |
lang
|
protected int |
level
Compression level to be used. |
| Constructor Summary | |
|---|---|
CompressedBLOB(byte[] b)
|
|
CompressedBLOB(int external_format,
java.lang.String v)
|
|
CompressedBLOB(java.lang.String v)
|
|
| Method Summary | |
|---|---|
java.lang.String |
decompress()
Given the binary data, determine the external form, correctly parse it and return the value as a String. |
byte[] |
getBytes()
Take the content we've been given and store it in the correct output format. |
static java.io.InputStream |
getCompressedInputStream(java.io.InputStream is)
Get the correct stream from the correctly underlying compression library. |
java.io.OutputStream |
getCompressedOutputStream(java.io.OutputStream os)
Get the correct stream from the correctly underlying compression library. |
java.lang.String |
getContent()
|
static int |
getExternalFormatIdentifier(byte[] b)
From a byte output stream return the external format revision it's using. |
void |
setLang(java.lang.String lang)
Set the lang of the target blog. |
java.lang.String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static boolean ENABLE_CACHED_BYTES
public static final int FORMAT_UNKNOWN
public static final int FORMAT_UTF8
public static final int FORMAT_BASE64_ZLIB
public static final int FORMAT_ZLIB
public static int EXTERNAL_FORMAT
public static int DEFAULT_LEVEL
public static java.lang.String ENCODING
public static int DECOMPRESSION_RATIO
public static int COMPRESSION_RATIO
public static int BUFFER_SIZE
protected java.lang.String content
protected byte[] b
protected java.lang.String lang
protected int external_format
protected int level
| Constructor Detail |
|---|
public CompressedBLOB(java.lang.String v)
public CompressedBLOB(int external_format,
java.lang.String v)
public CompressedBLOB(byte[] b)
| Method Detail |
|---|
public void setLang(java.lang.String lang)
public java.lang.String getContent()
throws java.lang.Exception
java.lang.Exception
public java.lang.String decompress()
throws java.lang.Exception
java.lang.Exception
public byte[] getBytes()
throws java.lang.Exception
java.lang.Exceptionpublic java.lang.String toString()
toString in class java.lang.Objectpublic java.io.OutputStream getCompressedOutputStream(java.io.OutputStream os)
public static java.io.InputStream getCompressedInputStream(java.io.InputStream is)
public static int getExternalFormatIdentifier(byte[] b)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||