gov.nih.nlm.util
Class UTF8InputStreamReader

java.lang.Object
  extended by java.io.Reader
      extended by java.io.InputStreamReader
          extended by gov.nih.nlm.util.UTF8InputStreamReader
All Implemented Interfaces:
Closeable, Readable

public class UTF8InputStreamReader
extends InputStreamReader

An InputStreamReader that ignores the first 3 bytes if they are the UTF8 Byte Order Mark (BOM) bytes.

Author:
Deborah Shapiro

Field Summary
 
Fields inherited from class java.io.Reader
lock
 
Constructor Summary
UTF8InputStreamReader(BufferedInputStream input_stream)
          Instantiates an UTF8InputStreamReader.
 
Method Summary
 boolean hasByteOrderMark()
          Indicates if the input stream has a Byte Order Mark or not.
 
Methods inherited from class java.io.InputStreamReader
close, getEncoding, read, read, ready
 
Methods inherited from class java.io.Reader
mark, markSupported, read, read, reset, skip
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UTF8InputStreamReader

public UTF8InputStreamReader(BufferedInputStream input_stream)
                      throws UnsupportedEncodingException,
                             IOException
Instantiates an UTF8InputStreamReader.

Parameters:
input_stream - BufferedInputStream
Throws:
UnsupportedEncodingException - if "UTF-8" is not suported
IOException - if anything goes wrong
Method Detail

hasByteOrderMark

public boolean hasByteOrderMark()
Indicates if the input stream has a Byte Order Mark or not.

Returns:
true if input stream has BOM false otherwise


Copyright ©2005