|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.continuent.tungsten.common.parsing.bytes.CharacterTranslationBuffer
public class CharacterTranslationBuffer
Implements a translation buffer for complex byte strings that allows clients to translate parts of the buffer directly to Unicode and to substitute other parts with different values.
| Constructor Summary | |
|---|---|
CharacterTranslationBuffer()
|
|
| Method Summary | |
|---|---|
void |
append(java.lang.String s)
Append a string to the output without affecting pending bytes. |
void |
appendAndClearPending(java.lang.String s)
Append a string to the output and clear pending bytes. |
void |
backoff(int goBack)
Backup current pointer or or more bytes. |
java.lang.String |
getOutput()
Returns the output value as a Java String. |
boolean |
hasNext()
Returns true if there are more bytes to read in the buffer. |
boolean |
isComplete()
Returns true if we have processed all bytes and the output is ready. |
void |
load(byte[] input,
int offset,
int length,
java.lang.String charset)
Initialize for translation. |
byte |
next()
Returns the next byte to process. |
void |
translateAndAppendPending(int backoff)
Translate pending bytes using selected character set. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public CharacterTranslationBuffer()
| Method Detail |
|---|
public void load(byte[] input,
int offset,
int length,
java.lang.String charset)
input - Byte buffer that is to be translatedoffset - Starting offset in buffer. 0 is the beginning.length - Length of the buffer. 0 denotes an empty buffer.charset - Name of character used to encode characters.public byte next()
public void backoff(int goBack)
public boolean hasNext()
public boolean isComplete()
public void append(java.lang.String s)
public void appendAndClearPending(java.lang.String s)
public void translateAndAppendPending(int backoff)
throws java.io.UnsupportedEncodingException
java.io.UnsupportedEncodingExceptionpublic java.lang.String getOutput()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||