R - the "Result" class (may be Void)public class SwitchableDecoder<R> extends AbstractIntPipeline<R>
An XML file declares its encoding on the prefix line, and an HTML can contain a META tag specifying the content type and encoding of the data. These rely on the declaration occurring early in the file, before any characters outside the base ASCII set are expected to be encountered.
This decoder allows the reading of an input stream to commence in ASCII decoding, switching to the full decoding once the declaration has been read.
| Constructor and Description |
|---|
SwitchableDecoder(IntAcceptor<R> downstream) |
| Modifier and Type | Method and Description |
|---|---|
void |
acceptInt(int value)
Accept an
int, after closed check and test for end of data. |
void |
switchTo(Charset charset) |
void |
switchTo(String charsetName) |
close, emit, flush, getResult, isCompleteacceptisClosedclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitaccept, accept, accept, accept, acceptisClosedpublic SwitchableDecoder(IntAcceptor<R> downstream)
public void acceptInt(int value)
throws Exception
AbstractIntAcceptorint, after closed check and test for end of data. Implementing classes must supply an
implementation of this method.acceptInt in class AbstractIntAcceptor<R>value - the input valueException - if thrown by a close() methodpublic void switchTo(Charset charset)
public void switchTo(String charsetName)
Copyright © 2020. All rights reserved.