public abstract class AbstractEncodedAppender extends java.lang.Object implements EncodedAppender
EncodedAppender interface| Constructor and Description |
|---|
AbstractEncodedAppender() |
| Modifier and Type | Method and Description |
|---|---|
void |
append(Encoder encoder,
EncodingState encodingState,
char[] b,
int off,
int len)
Encodes a portion of a char array and appends it to the buffer.
|
void |
append(Encoder encoder,
EncodingState encodingState,
java.lang.CharSequence str,
int off,
int len)
Encodes a portion of a string and appends it to the buffer.
|
void |
append(Encoder encoder,
StreamEncodeable streamEncodeable)
Encodes a
StreamEncodeable instance and appends it to the buffer. |
protected abstract void |
appendCharSequence(EncodingState encodingState,
java.lang.CharSequence str,
int start,
int end)
Append a portion of a CharSequence to the buffer and attach the
encodingState information to it
|
void |
appendEncoded(Encoder encoder,
EncodingState encodingState,
char[] b,
int off,
int len)
Appends an encoded portion of a char array to the buffer.
|
void |
appendEncoded(Encoder encoder,
EncodingState encodingState,
java.lang.CharSequence str,
int off,
int len)
Appends an encoded portion of a string to the buffer
|
protected EncodingState |
createNewEncodingState(Encoder encoder,
EncodingState encodingState) |
protected void |
encodeAndWrite(Encoder encoder,
EncodingState newEncodingState,
java.lang.CharSequence input)
Encode and write input to buffer using a non-streaming encoder
|
void |
flush()
Flush the internal buffer and write the buffered input to a possible
destination.
|
boolean |
isIgnoreEncodingState() |
void |
setIgnoreEncodingState(boolean ignoreEncodingState)
When enabled, will encode all input regardless of it's current state
disables double-encoding prevention.
|
boolean |
shouldEncode(Encoder encoderToApply,
EncodingState encodingState)
Check if the encoder should be used to a input with certain encodingState
|
protected boolean |
shouldEncodeWith(Encoder encoderToApply,
EncodingState encodingState) |
protected abstract void |
write(EncodingState encodingState,
char[] b,
int off,
int len)
Append a portion of a char array to the buffer and attach the
encodingState information to it
|
protected abstract void |
write(EncodingState encodingState,
java.lang.String str,
int off,
int len)
Append a portion of a string to the buffer and attach the encodingState
information to it
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcloseprotected abstract void write(EncodingState encodingState, char[] b, int off, int len) throws java.io.IOException
encodingState - the new encoding state of the char arrayb - a char arrayoff - Offset from which to start encoding characterslen - Number of characters to encodejava.io.IOException - Signals that an I/O exception has occurred.protected abstract void write(EncodingState encodingState, java.lang.String str, int off, int len) throws java.io.IOException
encodingState - the new encoding state of the stringstr - A Stringoff - Offset from which to start encoding characterslen - Number of characters to encodejava.io.IOException - Signals that an I/O exception has occurred.protected abstract void appendCharSequence(EncodingState encodingState, java.lang.CharSequence str, int start, int end) throws java.io.IOException
encodingState - the new encoding state of the CharSequence portionstr - a CharSequencestart - the start index, inclusiveend - the end index, exclusivejava.io.IOException - Signals that an I/O exception has occurred.public void append(Encoder encoder, EncodingState encodingState, char[] b, int off, int len) throws java.io.IOException
EncodedAppenderappend in interface EncodedAppenderencoder - the encoder to useencodingState - the current encoding state of the stringb - a char arrayoff - Offset from which to start encoding characterslen - Number of characters to encodejava.io.IOException - Signals that an I/O exception has occurred.protected EncodingState createNewEncodingState(Encoder encoder, EncodingState encodingState)
public void append(Encoder encoder, EncodingState encodingState, java.lang.CharSequence str, int off, int len) throws java.io.IOException
EncodedAppenderappend in interface EncodedAppenderencoder - the encoder to useencodingState - the current encoding state of the stringstr - A Stringoff - Offset from which to start encoding characterslen - Number of characters to encodejava.io.IOException - Signals that an I/O exception has occurred.public void appendEncoded(Encoder encoder, EncodingState encodingState, char[] b, int off, int len) throws java.io.IOException
EncodedAppenderappendEncoded in interface EncodedAppenderencoder - the encoder that has been appliedencodingState - the previous encoding state of the char arrayb - a char arrayoff - Offset from which to start encoding characterslen - Number of characters to encodejava.io.IOException - Signals that an I/O exception has occurred.public void appendEncoded(Encoder encoder, EncodingState encodingState, java.lang.CharSequence str, int off, int len) throws java.io.IOException
EncodedAppenderappendEncoded in interface EncodedAppenderencoder - the encoder that has been appliedencodingState - the previous encoding state of the stringstr - A Stringoff - Offset from which to start encoding characterslen - Number of characters to encodejava.io.IOException - Signals that an I/O exception has occurred.public boolean shouldEncode(Encoder encoderToApply, EncodingState encodingState)
shouldEncode in interface EncodedAppenderencoderToApply - the encoder to applyencodingState - the current encoding stateprotected boolean shouldEncodeWith(Encoder encoderToApply, EncodingState encodingState)
protected void encodeAndWrite(Encoder encoder, EncodingState newEncodingState, java.lang.CharSequence input) throws java.io.IOException
encoder - the encoder to usenewEncodingState - the new encoding state after encoder has been appliedinput - the input CharSequencejava.io.IOException - Signals that an I/O exception has occurred.public void append(Encoder encoder, StreamEncodeable streamEncodeable) throws java.io.IOException
EncodedAppenderStreamEncodeable instance and appends it to the buffer.append in interface EncodedAppenderencoder - the encoder to usestreamEncodeable - the instance to encodejava.io.IOException - Signals that an I/O exception has occurred.public void flush()
throws java.io.IOException
EncodedAppenderflush in interface EncodedAppenderjava.io.IOException - Signals that an I/O exception has occurred.public boolean isIgnoreEncodingState()
isIgnoreEncodingState in interface EncodedAppenderpublic void setIgnoreEncodingState(boolean ignoreEncodingState)
EncodedAppendersetIgnoreEncodingState in interface EncodedAppender