public class UnicodeHelper extends Object
Constructor and Description |
---|
UnicodeHelper(IUnicodeCompressor uc) |
Modifier and Type | Method and Description |
---|---|
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.
|
public UnicodeHelper(IUnicodeCompressor uc)
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.IOException
public 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
Copyright © 2006–2019 SYSTAP, LLC DBA Blazegraph. All rights reserved.