gnu.text

Class LineInputStreamReader


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_SIZE, buffer, in, limit, lineNumber, markPos, pos, readAheadLimit, readState

Constructor Summary

LineInputStreamReader(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(Charset cset)
void
setCharset(String name)

Methods inherited from class gnu.text.LineBufferedReader

close, fill, getColumnNumber, getConvertCR, getLineNumber, getName, getPath, getReadState, incrLineNumber, lineStart, mark, markSupported, peek, read, read, readLine, readLine, ready, reset, setBuffer, setConvertCR, setKeepFullLines, setLineNumber, setName, setPath, skip, skip, skipRestOfLine, skip_quick, unread, unread_quick

Constructor Details

LineInputStreamReader

public LineInputStreamReader(InputStream in)

Method Details

close

public void close()
            throws IOException
Overrides:
close in interface LineBufferedReader

fill

public int fill(int len)
            throws java.io.IOException
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 interface LineBufferedReader

getByte

public int getByte()
            throws java.io.IOException

markStart

public void markStart()
            throws java.io.IOException

ready

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

resetStart

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

setCharset

public void setCharset(Charset cset)

setCharset

public void setCharset(String name)