R - the "Result" class (may be Void)public class DynamicDecoder<R> extends SwitchableDecoder<R>
| Modifier and Type | Class and Description |
|---|---|
static class |
DynamicDecoder.State |
| Modifier and Type | Field and Description |
|---|---|
protected DynamicDecoder.State |
state |
delegate| Constructor and Description |
|---|
DynamicDecoder(IntAcceptor<? extends R> downstream)
Construct a
DynamicDecoder with the specified downstream IntAcceptor. |
DynamicDecoder(IntAcceptor<? extends R> downstream,
Charset charset)
Construct a
DynamicDecoder with the specified downstream IntAcceptor, switching immediately to
the specified Charset if specified. |
| Modifier and Type | Method and Description |
|---|---|
void |
acceptInt(int value)
Accept an
int (after closed check and test for end of data). |
void |
close()
Close the pipeline.
|
boolean |
isStageComplete()
Return
true if all sequences in the input to this stage of the pipeline are complete, that is, the input
is not in the middle of a sequence requiring more data. |
void |
switchTo(Charset charset)
Switch to the nominated character set.
|
void |
switchTo(IntAcceptor<? extends R> delegate)
Switch to the specified delegate.
|
void |
switchTo(String charsetName)
Switch to the nominated character set.
|
emit, flush, getDownstreamaccept, acceptisClosedclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitaccept, accept, accept, accept, accept, accept, accept, accept, accept, acceptandThengetResult, isCompleteisClosed, safeCloseprotected DynamicDecoder.State state
public DynamicDecoder(IntAcceptor<? extends R> downstream)
DynamicDecoder with the specified downstream IntAcceptor.downstream - the downstream IntAcceptorpublic DynamicDecoder(IntAcceptor<? extends R> downstream, Charset charset)
DynamicDecoder with the specified downstream IntAcceptor, switching immediately to
the specified Charset if specified. This bypasses much of the functionality of the
DynamicDecoder, but allowing the Charset to be specified in this way simplifies the creation of a
decoder in those cases where the encoding may be, but is not always, known in advance.downstream - the downstream IntAcceptorcharset - the Charset if known, or null to allow dynamic encoding determinationpublic void acceptInt(int value)
int (after closed check and test for end of data). This function operates as a "state
machine", with much of the complexity involved in the examination of the first four characters of the stream to
recognise big-endian and little-endian UTF-16 and UTF-32 encodings.
If the stream appears to consist of 8-bit characters, it is placed in an indeterminate state until a character
above 0x80 is encountered, at which point the decoder will check whether the subsequent characters are
consistent with a UTF-8 encoding sequence, in which case that encoding will be assumed for the remainder of the
stream; otherwise the Windows-1252 encoding is assumed.
acceptInt in class SwitchableDecoder<R>value - the input valuepublic void close()
close in interface AutoCloseableclose in class AbstractIntPipeline<R>public boolean isStageComplete()
true if all sequences in the input to this stage of the pipeline are complete, that is, the input
is not in the middle of a sequence requiring more data.isStageComplete in interface BasePipeline<R>isStageComplete in class SwitchableDecoder<R>true if the input is in the "complete" statepublic void switchTo(IntAcceptor<? extends R> delegate)
switchTo in class SwitchableDecoder<R>delegate - the new delegatepublic void switchTo(Charset charset)
switchTo in class SwitchableDecoder<R>charset - the Charsetpublic void switchTo(String charsetName)
switchTo in class SwitchableDecoder<R>charsetName - the character set nameCopyright © 2025. All rights reserved.