|
Class calypso.util.LineBufferingInputStream
All Packages This Package Class Hierarchy Class Search Index
Class calypso.util.LineBufferingInputStream
java.lang.Object
|
+----java.io.InputStream
|
+----java.io.FilterInputStream
|
+----calypso.util.LineBufferingInputStream
public class LineBufferingInputStream
extends java.io.FilterInputStream
{
// Fields 7
private static final int CAPACITY;
private static final boolean DEBUG;
ByteBuf curline;
boolean eof;
ByteBuf inbuf;
ByteLineBuffer linebuf;
byte[] singlebyte;
// Constructors 1
public LineBufferingInputStream(InputStream);
// Methods 8
public void close() throws IOException;
public boolean markSupported();
public int read() throws IOException;
public int read(byte[]) throws IOException;
public int read(byte[], int, int) throws IOException;
public void setInputEOL(ByteBuf);
public void setOutputEOL(ByteBuf);
public long skip(long);
}
Fields
private static final boolean DEBUG
private static final int CAPACITY
ByteBuf curline
ByteBuf inbuf
ByteLineBuffer linebuf
boolean eof
byte[] singlebyte
Constructors
public LineBufferingInputStream(InputStream s)
Methods
public int read(byte[] buf,
int start,
int length) throws IOException
Reads bytes into a portion of an array. This method will block
until some input is available.
The returned data will not be more than one line long: that is, there
will be at most one linebreak (CR, LF, or CRLF) and if it is present,
it will be at the end.
If the next line available to be read is smaller than `length',
then the first `length' bytes of that line will be returned, and
the remainder of the bytes on that line will be available for
subsequent reads.
- Returns:
- the total number of bytes read into the buffer, or -1 if
there is no more data because the end of the stream has
been reached.
- Overrides:
- read in class FilterInputStream
public int read(byte[] buf) throws IOException
- Overrides:
- read in class FilterInputStream
public int read() throws IOException
- Overrides:
- read in class FilterInputStream
public long skip(long n)
- Overrides:
- skip in class FilterInputStream
public boolean markSupported()
- Overrides:
- markSupported in class FilterInputStream
public void close() throws IOException
- Overrides:
- close in class FilterInputStream
public void setInputEOL(ByteBuf buf)
Sets the EOL characters to look for in the incoming stream. Setting
this to be null will cause it to look for any of , , or .
Note that null (the default) could cause up to one extra to be held in
the buffer (in the case where the last byte read from the underlying
stream was , and no following byte (or EOF) has yet been read.)
public void setOutputEOL(ByteBuf buf)
End of line characters & or any combination
will be replaced by this string if it is present. Setting
this to a zero length string will cause them to be stripped.
Setting this to null will cause the EOL characters to be passed
through unchanged (the default).
| Parameter | Description |
| buf | ByteBuf representing EOL replacement string |
All Packages This Package Class Hierarchy Class Search Index
Freshly brewed Java API Documentation automatically generated with polardoc Version 1.0.4
|