gnu.text
Class LineInputStreamReader

java.lang.Object
  extended by java.io.Reader
      extended by gnu.text.LineBufferedReader
          extended by gnu.text.LineInputStreamReader
All Implemented Interfaces:
java.io.Closeable, java.lang.Readable

public class LineInputStreamReader
extends LineBufferedReader

A LineBufferedReader that wraps an InputStream. Similar functionality as using an InputStreamReader, but provides hooks to read at the byte level before setting the charset. Optionally uses java.nio.charset directly, for extra flexibility and a possible (but slight and unverified) performance improvement.


Field Summary
 
Fields inherited from class gnu.text.LineBufferedReader
buffer, BUFFER_SIZE, in, limit, lineNumber, markPos, pos, readAheadLimit, readState
 
Fields inherited from class java.io.Reader
lock
 
Constructor Summary
LineInputStreamReader(java.io.InputStream in)
           
 
Method Summary
 void close()
           
 int fill(int len)
          Called by read() when it needs its buffer filled.
 int getByte()
           
 void markStart()
           
 boolean ready()
           
 void resetStart(int pos)
           
 void setCharset(java.nio.charset.Charset cset)
           
 void setCharset(java.lang.String name)
           
 
Methods inherited from class gnu.text.LineBufferedReader
getColumnNumber, getConvertCR, getLineNumber, getName, getPath, getReadState, incrLineNumber, lineStart, mark, markSupported, peek, read, read, readLine, readLine, reset, setBuffer, setConvertCR, setKeepFullLines, setLineNumber, setName, setPath, skip_quick, skip, skip, skipRestOfLine, unread_quick, unread
 
Methods inherited from class java.io.Reader
read, read, skip
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LineInputStreamReader

public LineInputStreamReader(java.io.InputStream in)
Method Detail

setCharset

public void setCharset(java.nio.charset.Charset cset)

setCharset

public void setCharset(java.lang.String name)

close

public void close()
           throws java.io.IOException
Specified by:
close in interface java.io.Closeable
Overrides:
close in class LineBufferedReader
Throws:
java.io.IOException

markStart

public void markStart()
               throws java.io.IOException
Throws:
java.io.IOException

resetStart

public void resetStart(int pos)
                throws java.io.IOException
Throws:
java.io.IOException

getByte

public int getByte()
            throws java.io.IOException
Throws:
java.io.IOException

fill

public int fill(int len)
         throws java.io.IOException
Description copied from class: LineBufferedReader
Called by read() when it needs its buffer filled. Read characters into buffer, starting at off, for len. Can assume that len > 0. Only called if pos>=limit. Return -1 if EOF, otherwise number of read chars. This can be usefully overridden by sub-classes.

Overrides:
fill in class LineBufferedReader
Throws:
java.io.IOException

ready

public boolean ready()
              throws java.io.IOException
Overrides:
ready in class LineBufferedReader
Throws:
java.io.IOException