public class LineInput
extends java.io.FilterInputStream
| Modifier and Type | Class and Description |
|---|---|
static class |
LineInput.LineBuffer
Reusable LineBuffer.
|
| Constructor and Description |
|---|
LineInput(java.io.InputStream in)
Constructor.
|
LineInput(java.io.InputStream in,
int bufferSize)
Constructor.
|
LineInput(java.io.InputStream in,
int bufferSize,
java.lang.String encoding)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
int |
available() |
void |
destroy() |
int |
getByteLimit()
Get the byte limit.
|
java.io.InputStream |
getInputStream() |
void |
mark(int limit) |
boolean |
markSupported() |
int |
read() |
int |
read(byte[] b,
int off,
int len) |
java.lang.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) |
public LineInput(java.io.InputStream in)
in - The underlying input stream.public LineInput(java.io.InputStream in,
int bufferSize)
in - The underlying input stream.bufferSize - The buffer size and maximum line length.public LineInput(java.io.InputStream in,
int bufferSize,
java.lang.String encoding)
throws java.io.UnsupportedEncodingException
in - The underlying input stream.bufferSize - The buffer size and maximum line length.encoding - the character encoding to use for readLine methods.java.io.UnsupportedEncodingExceptionpublic java.io.InputStream getInputStream()
public void setByteLimit(int bytes)
bytes - Limit number of bytes, or -1 for no limit.public int getByteLimit()
public java.lang.String readLine()
throws java.io.IOException
java.io.IOExceptionpublic int readLine(char[] c,
int off,
int len)
throws java.io.IOException
c - Character buffer to place the line into.off - Offset into the buffer.len - Maximum length of line.java.io.IOExceptionpublic int readLine(byte[] b,
int off,
int len)
throws java.io.IOException
b - Byte array to place the line into.off - Offset into the buffer.len - Maximum length of line.java.io.IOExceptionpublic LineInput.LineBuffer readLineBuffer() throws java.io.IOException
java.io.IOExceptionpublic LineInput.LineBuffer readLineBuffer(int len) throws java.io.IOException
len - Maximum length of a line, or 0 for defaultjava.io.IOExceptionpublic int read()
throws java.io.IOException
read in class java.io.FilterInputStreamjava.io.IOExceptionpublic int read(byte[] b,
int off,
int len)
throws java.io.IOException
read in class java.io.FilterInputStreamjava.io.IOExceptionpublic long skip(long n)
throws java.io.IOException
skip in class java.io.FilterInputStreamjava.io.IOExceptionpublic int available()
throws java.io.IOException
available in class java.io.FilterInputStreamjava.io.IOExceptionpublic void mark(int limit)
throws java.lang.IllegalArgumentException
mark in class java.io.FilterInputStreamjava.lang.IllegalArgumentExceptionpublic void reset()
throws java.io.IOException
reset in class java.io.FilterInputStreamjava.io.IOExceptionpublic boolean markSupported()
markSupported in class java.io.FilterInputStreampublic void destroy()
Copyright © 2004 Mortbay Consulting Pty. Ltd. All Rights Reserved.