|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sf.asyncobjects.AsyncUnicastServer<FacetType> net.sf.asyncobjects.util.CloseableWrapper<ATextOutput,AByteOutput> net.sf.asyncobjects.io.EncoderTextOutput
public class EncoderTextOutput
An output that encodes the text into binary. The encoder uses an instance of
BufferProvider
for buffer management.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class net.sf.asyncobjects.util.CloseableWrapper |
---|
CloseableWrapper.InvalidatingWhen<I,R> |
Field Summary |
---|
Fields inherited from class net.sf.asyncobjects.util.CloseableWrapper |
---|
closeWrapper, requests, wrapped |
Constructor Summary | |
---|---|
EncoderTextOutput(BufferProvider buffers,
CharsetEncoder encoder,
AByteOutput out,
boolean closeStream)
A constructor |
|
EncoderTextOutput(CharsetEncoder encoder,
AByteOutput out,
boolean closeStream)
A constructor |
|
EncoderTextOutput(String encoding,
AByteOutput out)
A constructor |
Method Summary | |
---|---|
protected Promise<Void> |
beforeClose()
Handle close operation |
Promise<Void> |
flush()
Flush data in stream, upon return of this method all data will be written out to most underlying layer |
void |
onMalformedInput(CodingErrorAction newAction)
Configure encoder to execute specifed action on malformed input |
void |
onUnmappableCharacter(CodingErrorAction newAction)
Configure encoder to execute specifed action on unmappable character |
void |
replaceWith(byte[] newReplacement)
Specify replacement |
Promise<Void> |
write(TextData data)
Encode data |
Methods inherited from class net.sf.asyncobjects.util.CloseableWrapper |
---|
afterInvalidate, close, closed, ensureOpen, ensureValid, invalidate, isValid |
Methods inherited from class net.sf.asyncobjects.AsyncUnicastServer |
---|
dereference, export, isImmediate, myVat, promise |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface net.sf.asyncobjects.ACloseable |
---|
close |
Methods inherited from interface net.sf.asyncobjects.AsyncObject |
---|
dereference, isImmediate |
Constructor Detail |
---|
public EncoderTextOutput(String encoding, AByteOutput out)
encoding
- an encoding idout
- an output streampublic EncoderTextOutput(CharsetEncoder encoder, AByteOutput out, boolean closeStream)
encoder
- an encoderout
- an output streamcloseStream
- if true the stream must be closedpublic EncoderTextOutput(BufferProvider buffers, CharsetEncoder encoder, AByteOutput out, boolean closeStream)
buffers
- a buffer providerencoder
- an encoderout
- an output streamcloseStream
- if true the stream must be closedMethod Detail |
---|
public void onMalformedInput(CodingErrorAction newAction)
newAction
- a new actionpublic void onUnmappableCharacter(CodingErrorAction newAction)
newAction
- a new actionpublic void replaceWith(byte[] newReplacement)
newReplacement
- a new replacementpublic Promise<Void> flush()
AOutput
flush
in interface AOutput<TextData>
AOutput.flush()
public Promise<Void> write(TextData data)
write
in interface AOutput<TextData>
data
- a data to encode
AOutput.write(net.sf.asyncobjects.io.BatchedData)
protected Promise<Void> beforeClose() throws Throwable
CloseableWrapper
beforeClose
in class CloseableWrapper<ATextOutput,AByteOutput>
Throwable
- if there is aproblem during executionCloseableWrapper.beforeClose()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |