InputStream that attempts to detect a Byte Order Mark (BOM) in the input
and derive the character encoding that should be used to decode the incoming content.
| Modifier and Type | Class and Description |
|---|---|
| public static class | BomInput.
Internal notification exception used to re-wrap the original |
| Modifier and Type | Field and Description |
|---|---|
| private int[] | |
| private int | |
| private int | |
| private String | |
| private IOException | |
| private final InputStream | |
| public static final byte[] | |
| public static final byte[] | |
| public static final byte[] | |
| public static final byte[] | |
| public static final byte[] |
| Access | Constructor and Description |
|---|---|
| public | BomInput(InputStream
the input whose first bytes should be analyzed. input)Wraps an |
| Modifier and Type | Method and Description |
|---|---|
| public void | close()
Overrides java. Implements java. |
| public final Charset | getCharset()
Returns the detected |
| public final String | Returns: the detected encoding name ornull if a BOM could not be matched.Returns the detected encoding name determined by the Byte Order Mark (BOM) available in the input provided in the constructor of this class. |
| public final boolean | Returns: false if there are no bytes stored and the original input stream can be used directly. If this wrapper
needs to be used to return stored bytes before, then true will be returned.Returns a flag indicating whether or not all bytes read from the wrapped input stream have been consumed. |
| private int | |
| public final int | read()
Implements abstract java. |
| private void |
| bytes | back to summary |
|---|---|
| private int[] bytes | |
| bytesRead | back to summary |
|---|---|
| private int bytesRead | |
| consumed | back to summary |
|---|---|
| private int consumed | |
| encoding | back to summary |
|---|---|
| private String encoding | |
| exception | back to summary |
|---|---|
| private IOException exception | |
| input | back to summary |
|---|---|
| private final InputStream input | |
| UTF_16BE_BOM | back to summary |
|---|---|
| public static final byte[] UTF_16BE_BOM | |
| UTF_16LE_BOM | back to summary |
|---|---|
| public static final byte[] UTF_16LE_BOM | |
| UTF_32BE_BOM | back to summary |
|---|---|
| public static final byte[] UTF_32BE_BOM | |
| UTF_32LE_BOM | back to summary |
|---|---|
| public static final byte[] UTF_32LE_BOM | |
| UTF_8_BOM | back to summary |
|---|---|
| public static final byte[] UTF_8_BOM | |
| BomInput | back to summary |
|---|---|
| public BomInput(InputStream input) Wraps an
| |
| close | back to summary |
|---|---|
| public void close() throws IOException Overrides java. Implements java. Doc from java. Closes this input stream and releases any system resources associated with the stream.
| |
| getCharset | back to summary |
|---|---|
| public final Charset getCharset() Returns the detected | |
| getEncoding | back to summary |
|---|---|
| public final String getEncoding() Returns the detected encoding name determined by the Byte Order Mark (BOM) available in the
input provided in the constructor of this class.
If no BOM was detected, this method will return
| |
| hasBytesStored | back to summary |
|---|---|
| public final boolean hasBytesStored() Returns a flag indicating whether or not all bytes read from the wrapped input stream have been consumed. This
allows client code to determine if the original input stream can be used directly and safely, or if this
| |
| next | back to summary |
|---|---|
| private int next() throws IOException | |
| read | back to summary |
|---|---|
| public final int read() throws IOException Implements abstract java. Doc from java. Reads the next byte of data from the input stream. The value byte is
returned as an
| |
| setEncoding | back to summary |
|---|---|
| private void setEncoding(String encoding) | |
InputStream into a Reader.
This is required for performance reasons as overriding InputStream#read() incurs a heavy performance
penalty when the implementation is native (as in FileInputStream#read().
| Modifier and Type | Field and Description |
|---|---|
| public final String | |
| public final InputStream |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public Throwable | fillInStackTrace()
Overrides java. |
| encoding | back to summary |
|---|---|
| public final String encoding | |
| input | back to summary |
|---|---|
| public final InputStream input | |
| BytesProcessedNotification | back to summary |
|---|---|
| public BytesProcessedNotification(InputStream input, String encoding) | |
| fillInStackTrace | back to summary |
|---|---|
| public Throwable fillInStackTrace() Overrides java. Doc from java. Fills in the execution stack trace. This method records within this
If the stack trace of this | |