|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.bigdata.io.compression.UnicodeHelper
public class UnicodeHelper
Utility class for compressed unicode encode/decode.
| Constructor Summary | |
|---|---|
UnicodeHelper(IUnicodeCompressor uc)
|
|
| Method Summary | |
|---|---|
int |
decode(InputStream in,
StringBuilder out)
Decode a String from the input stream. |
String |
decode1(DataInputBuffer in,
StringBuilder tmp)
Decode a String from the input stream. |
int |
encode(String s,
OutputStream out,
ByteArrayBuffer tmp)
Encode the String onto the OutputStream. |
byte[] |
encode1(String s)
Encode a Unicode string. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public UnicodeHelper(IUnicodeCompressor uc)
| Method Detail |
|---|
public int encode(String s,
OutputStream out,
ByteArrayBuffer tmp)
throws IOException
String onto the OutputStream. The temporary
buffer is used to perform the encoding. The byte length of the encoding
is written out using a packed long integer format followed by the coded
bytes. This method is capable of writing out very long strings.
s - The character data.out - The output stream.tmp - The temporary buffer.
IOExceptionpublic byte[] encode1(String s)
s - The string.
public int decode(InputStream in,
StringBuilder out)
throws IOException
String from the input stream. The result is appended
into the caller's buffer. The caller is responsible for resetting the
buffer as necessary.
in - The input stream.out - The output buffer.
IOException
public String decode1(DataInputBuffer in,
StringBuilder tmp)
throws IOException
String from the input stream.
in - The input stream.tmp - The temporary buffer used to decode the data. The buffer will
be reset automatically by this method.
IOException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||