guk
Class GukBomStrippingInputStreamReader
java.lang.Object
java.io.Reader
java.io.BufferedReader
guk.GukBomStrippingInputStreamReader
- All Implemented Interfaces:
- Closeable, Readable
public class GukBomStrippingInputStreamReader
- extends BufferedReader
StreamReader that removes the Unicode BOM, even when Sun/Oracle is
too lazy to do so. Since a buffer is required, and since most of GATE
was coded to use BufferedReaders around the InputStreamReader, this
'isa' BufferedReader.
Note that there are differences in exception behaviour on the
different InputStreamReader constructors, so this has to be careful
to call the right one.
Note This class is a copy of BomStrippingInputStreamReader
from gate.util. GUK cannot reference gate.util directly at runtime
due to classloader issues, and we do not want to force GATE embedded
to depend on GUK, therefore copying the class was considered the
least bad option. If the gate.util class is modified, this class
should also be modified to match.
GukBomStrippingInputStreamReader
public GukBomStrippingInputStreamReader(InputStream in)
GukBomStrippingInputStreamReader
public GukBomStrippingInputStreamReader(InputStream in,
String charsetName)
throws UnsupportedEncodingException
- Throws:
UnsupportedEncodingException
GukBomStrippingInputStreamReader
public GukBomStrippingInputStreamReader(InputStream in,
String charsetName,
int bufferSize)
throws UnsupportedEncodingException
- Throws:
UnsupportedEncodingException
GukBomStrippingInputStreamReader
public GukBomStrippingInputStreamReader(InputStream in,
Charset cs)
GukBomStrippingInputStreamReader
public GukBomStrippingInputStreamReader(InputStream in,
int bufferSize)
GukBomStrippingInputStreamReader
public GukBomStrippingInputStreamReader(InputStream in,
CharsetDecoder dec,
int bufferSize)
GukBomStrippingInputStreamReader
public GukBomStrippingInputStreamReader(InputStream in,
CharsetDecoder dec)
hashCode
public int hashCode()
- Overrides:
hashCode in class Object
equals
public boolean equals(Object obj)
- Overrides:
equals in class Object
read
public int read(CharBuffer target)
throws IOException
- Specified by:
read in interface Readable- Overrides:
read in class Reader
- Throws:
IOException
read
public int read(char[] cbuf)
throws IOException
- Overrides:
read in class Reader
- Throws:
IOException
read
public int read()
throws IOException
- Overrides:
read in class BufferedReader
- Throws:
IOException
read
public int read(char[] cbuf,
int off,
int len)
throws IOException
- Overrides:
read in class BufferedReader
- Throws:
IOException
readLine
public String readLine()
throws IOException
- Overrides:
readLine in class BufferedReader
- Throws:
IOException
skip
public long skip(long n)
throws IOException
- Overrides:
skip in class BufferedReader
- Throws:
IOException
ready
public boolean ready()
throws IOException
- Overrides:
ready in class BufferedReader
- Throws:
IOException
markSupported
public boolean markSupported()
- Overrides:
markSupported in class BufferedReader
mark
public void mark(int readAheadLimit)
throws IOException
- Overrides:
mark in class BufferedReader
- Throws:
IOException
reset
public void reset()
throws IOException
- Overrides:
reset in class BufferedReader
- Throws:
IOException
close
public void close()
throws IOException
- Specified by:
close in interface Closeable- Overrides:
close in class BufferedReader
- Throws:
IOException