|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjava.io.InputStream
jodd.io.UnicodeInputStream
public class UnicodeInputStream
Unicode input stream detects and decodes BOM character. Detects following BOMs: UTF-8, UTF-16BE, UTF-16LE, UTF-32BE, UTF-32LE.
| Field Summary | |
|---|---|
static int |
MAX_BOM_SIZE
|
| Constructor Summary | |
|---|---|
UnicodeInputStream(java.io.InputStream in)
Creates new unicode stream with default UTF-8 encoding. |
|
UnicodeInputStream(java.io.InputStream in,
java.lang.String defaultEncoding)
Creates new unicode stream with provided default encoding. |
|
| Method Summary | |
|---|---|
void |
close()
Closes input stream. |
int |
getBOMSize()
Returns BOM size in bytes. |
java.lang.String |
getDefaultEncoding()
Returns default encoding. |
java.lang.String |
getEncoding()
Returns detected encoding. |
protected void |
init()
Detects and decodes encoding from BOM character. |
int |
read()
Reads byte from the stream. |
| Methods inherited from class java.io.InputStream |
|---|
available, mark, markSupported, read, read, reset, skip |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int MAX_BOM_SIZE
| Constructor Detail |
|---|
public UnicodeInputStream(java.io.InputStream in)
public UnicodeInputStream(java.io.InputStream in,
java.lang.String defaultEncoding)
| Method Detail |
|---|
public java.lang.String getDefaultEncoding()
public java.lang.String getEncoding()
initalized first.
protected void init()
throws java.io.IOException
java.io.IOException
public void close()
throws java.io.IOException
close in interface java.io.Closeableclose in class java.io.InputStreamjava.io.IOException
public int read()
throws java.io.IOException
read in class java.io.InputStreamjava.io.IOExceptionpublic int getBOMSize()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||