de.glossmaker.common.io
Class UnicodeInputStream
java.lang.Object
java.io.InputStream
de.glossmaker.common.io.UnicodeInputStream
- All Implemented Interfaces:
- Closeable
public class UnicodeInputStream
- extends InputStream
This inputstream will recognize unicode BOM marks and will skip bytes if
getEncoding() method is called before any of the read(...) methods.
- Author:
- Aki Nieminen
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
UnicodeInputStream
public UnicodeInputStream(InputStream in,
String defaultEnc)
getDefaultEncoding
public String getDefaultEncoding()
getEncoding
public String getEncoding()
init
protected void init()
throws IOException
- Read-ahead four bytes and check for BOM marks. Extra bytes are unread
back to the stream, only BOM bytes are skipped.
- Throws:
IOException
close
public void close()
throws IOException
- Specified by:
close
in interface Closeable
- Overrides:
close
in class InputStream
- Throws:
IOException
read
public int read()
throws IOException
- Specified by:
read
in class InputStream
- Throws:
IOException
Copyright © 2010 - 2011 Markus Flingelli. All Rights Reserved.