public class BufferedData extends ExpandableBuffer
ByteBuffer.
This class is not thread safe.
ExpandableBuffer.Mode| Modifier | Constructor and Description |
|---|---|
protected |
BufferedData(int bufferSize) |
| Modifier and Type | Method and Description |
|---|---|
static BufferedData |
allocate(int bufferSize) |
int |
capacity()
Returns available capacity of this buffer.
|
void |
clear()
Clears buffer.
|
ByteBuffer |
data() |
boolean |
hasData()
Determines if the buffer contains data.
|
int |
length()
Returns the length of this buffer.
|
void |
put(ByteBuffer src) |
int |
readFrom(ReadableByteChannel channel) |
int |
writeTo(WritableByteChannel dst) |
buffer, ensureAdjustedCapacity, ensureCapacity, expand, mode, setInputMode, setOutputMode, toStringpublic static BufferedData allocate(int bufferSize)
public final boolean hasData()
ExpandableBufferSets the mode to output.
hasData in class ExpandableBuffertrue if there is data in the buffer,
false otherwise.public final int length()
ExpandableBufferSets the mode to output.
length in class ExpandableBufferpublic final int capacity()
ExpandableBuffercapacity in class ExpandableBufferpublic final void clear()
ExpandableBufferSets the mode to input.
clear in class ExpandableBufferpublic final void put(ByteBuffer src)
public final int readFrom(ReadableByteChannel channel) throws IOException
IOExceptionpublic final int writeTo(WritableByteChannel dst) throws IOException
IOExceptionpublic final ByteBuffer data()
Copyright © 2005–2022 The Apache Software Foundation. All rights reserved.