org.norther.tammi.acorn.io
Class UnicodeInputStream
java.lang.Object
java.io.InputStream
java.io.FilterInputStream
java.io.BufferedInputStream
org.norther.tammi.acorn.io.UnicodeInputStream
- All Implemented Interfaces:
- Closeable
- Direct Known Subclasses:
- FileInputStream
public class UnicodeInputStream
- extends BufferedInputStream
A buffered input stream with Unicode BOM recognition.
- Author:
- Thomas Weidenfeller, Aki Nieminen, Ilkka Priha
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
UnicodeInputStream
public UnicodeInputStream(InputStream input)
- Constructs a new stream.
- Parameters:
input - the non-buffered stream.
UnicodeInputStream
public UnicodeInputStream(InputStream input,
String enc)
throws IOException
- Constructs a new stream with an encoding check.
- Parameters:
input - the non-buffered stream.enc - an optional default encoding.
- Throws:
IOException - on I/O errors.
read
public int read()
throws IOException
- Overrides:
read in class BufferedInputStream
- Throws:
IOException
read
public int read(byte[] b,
int off,
int len)
throws IOException
- Overrides:
read in class BufferedInputStream
- Throws:
IOException
skip
public long skip(long n)
throws IOException
- Overrides:
skip in class BufferedInputStream
- Throws:
IOException
close
public void close()
throws IOException
- Specified by:
close in interface Closeable- Overrides:
close in class BufferedInputStream
- Throws:
IOException
getEncoding
public String getEncoding()
throws IOException
- Gets the Unicode encoding of this stream.
- Returns:
- the Unicode encoding or the default encoding.
- Throws:
IOException - on I/O errors.
Copyright © 2004 The Norther Organization. All rights reserved.