public class LineInput extends FilterInputStream
| Modifier and Type | Class and Description |
|---|---|
static class |
LineInput.LineBuffer
Reusable LineBuffer.
|
in| Constructor and Description |
|---|
LineInput(InputStream in)
Constructor.
|
LineInput(InputStream in,
int bufferSize)
Constructor.
|
LineInput(InputStream in,
int bufferSize,
String encoding)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
int |
available() |
void |
destroy() |
int |
getByteLimit()
Get the byte limit.
|
InputStream |
getInputStream() |
void |
mark(int limit) |
boolean |
markSupported() |
int |
read() |
int |
read(byte[] b,
int off,
int len) |
String |
readLine()
Read a line ended by CR, LF or CRLF.
|
int |
readLine(byte[] b,
int off,
int len)
Read a line ended by CR, LF or CRLF.
|
int |
readLine(char[] c,
int off,
int len)
Read a line ended by CR, LF or CRLF.
|
LineInput.LineBuffer |
readLineBuffer()
Read a Line ended by CR, LF or CRLF.
|
LineInput.LineBuffer |
readLineBuffer(int len)
Read a Line ended by CR, LF or CRLF.
|
void |
reset() |
void |
setByteLimit(int bytes)
Set the byte limit.
|
long |
skip(long n) |
close, readpublic LineInput(InputStream in)
in - The underlying input stream.public LineInput(InputStream in, int bufferSize)
in - The underlying input stream.bufferSize - The buffer size and maximum line length.public LineInput(InputStream in, int bufferSize, String encoding) throws UnsupportedEncodingException
in - The underlying input stream.bufferSize - The buffer size and maximum line length.encoding - the character encoding to use for readLine methods.UnsupportedEncodingExceptionpublic InputStream getInputStream()
public void setByteLimit(int bytes)
bytes - Limit number of bytes, or -1 for no limit.public int getByteLimit()
public String readLine() throws IOException
IOExceptionpublic int readLine(char[] c,
int off,
int len)
throws IOException
c - Character buffer to place the line into.off - Offset into the buffer.len - Maximum length of line.IOExceptionpublic int readLine(byte[] b,
int off,
int len)
throws IOException
b - Byte array to place the line into.off - Offset into the buffer.len - Maximum length of line.IOExceptionpublic LineInput.LineBuffer readLineBuffer() throws IOException
IOExceptionpublic LineInput.LineBuffer readLineBuffer(int len) throws IOException
len - Maximum length of a line, or 0 for defaultIOExceptionpublic int read()
throws IOException
read in class FilterInputStreamIOExceptionpublic int read(byte[] b,
int off,
int len)
throws IOException
read in class FilterInputStreamIOExceptionpublic long skip(long n)
throws IOException
skip in class FilterInputStreamIOExceptionpublic int available()
throws IOException
available in class FilterInputStreamIOExceptionpublic void mark(int limit)
throws IllegalArgumentException
mark in class FilterInputStreamIllegalArgumentExceptionpublic void reset()
throws IOException
reset in class FilterInputStreamIOExceptionpublic boolean markSupported()
markSupported in class FilterInputStreampublic void destroy()
Copyright © 2013. All rights reserved.