public class BytesDataInfo extends DataInfo
Specialized DataInfo for byte array content.
FLAG_CLOSE, FLAG_COMPRESS| Constructor and Description |
|---|
BytesDataInfo(byte[] bytes,
boolean close) |
BytesDataInfo(byte[] bytes,
boolean close,
boolean compress) |
| Modifier and Type | Method and Description |
|---|---|
int |
available()
Returns the available content bytes that can be read via
DataInfo.readInto(ByteBuffer). |
int |
length() |
int |
readInto(ByteBuffer output)
Copies the content bytes of this
DataInfo into the given ByteBuffer. |
allocate, asByteBuffer, asBytes, asString, consume, consumed, consumeInto, getFlags, isClose, isCompress, setClose, setCompress, toStringpublic BytesDataInfo(byte[] bytes,
boolean close)
public BytesDataInfo(byte[] bytes,
boolean close,
boolean compress)
public int length()
length in class DataInfoDataInfo.available()public int available()
DataInfoReturns the available content bytes that can be read via DataInfo.readInto(ByteBuffer).
Each invocation to DataInfo.readInto(ByteBuffer) modifies the value returned by this method,
until no more content bytes are available.
available in class DataInfoDataInfo.readInto(ByteBuffer)public int readInto(ByteBuffer output)
DataInfoCopies the content bytes of this DataInfo into the given ByteBuffer.
If the given ByteBuffer cannot contain the whole content of this DataInfo
then after the read DataInfo.available() will return a positive value, and further content
may be retrieved by invoking again this method with a new output buffer.
readInto in class DataInfooutput - the ByteBuffer to copy to bytes intoDataInfo.available(),
DataInfo.consumeInto(ByteBuffer)Copyright © 1995-2012 Mort Bay Consulting. All Rights Reserved.