All Packages This Package Class Hierarchy Class Search Index
Class calypso.util.ByteLineBuffer
java.lang.Object | +----calypso.util.ByteLineBuffer
This class is stores data in a private ByteBuf appending new data as needed, and returning line separated data.
public class ByteLineBuffer extends java.lang.Object { // Fields 5 private static final boolean DEBUG; private ByteBuf buffer; private boolean buffer_full; private ByteBuf inputeol; private ByteBuf outputeol; // Constructors 1 public ByteLineBuffer(); // Methods 5 public boolean pullLine(ByteBuf); public void pushBytes(ByteBuf); public void pushEOF(); public void setInputEOL(ByteBuf); public void setOutputEOL(ByteBuf); }
Fields
DEBUG
private static final boolean DEBUG
buffer_full
private boolean buffer_full
buffer
private ByteBuf buffer
outputeol
private ByteBuf outputeol
inputeol
private ByteBuf inputeol
Constructors
ByteLineBuffer
public ByteLineBuffer()
Constructs an empty ByteLineBuffer.
Methods
pushBytes
public void pushBytes(ByteBuf buf)
Appends data to the end of the internal ByteBuf.
Parameter Description buf data to append to internal buffer
pushEOF
public void pushEOF()
indicates that the last piece of data is now present.
setInputEOL
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.)
setOutputEOL
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
pullLine
public boolean pullLine(ByteBuf buf)
Returns a ByteBuf with a line of data which was separated by
or any combination. Holds the last line in the ByteBuf until pushEOF() is called. If a ByteBuf containing data is sent in, the data is removed.
Parameter Description buf single line of data in a ByteBuf
- Returns:
- true if a line was retrieved, false if not
All Packages This Package Class Hierarchy Class Search IndexFreshly brewed Java API Documentation automatically generated with polardoc Version 1.0.4