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, toString
public static BufferedData allocate(int bufferSize)
public final boolean hasData()
ExpandableBuffer
Sets the mode to output.
hasData
in class ExpandableBuffer
true
if there is data in the buffer,
false
otherwise.public final int length()
ExpandableBuffer
Sets the mode to output.
length
in class ExpandableBuffer
public final int capacity()
ExpandableBuffer
capacity
in class ExpandableBuffer
public final void clear()
ExpandableBuffer
Sets the mode to INPUT
.
clear
in class ExpandableBuffer
public final void put(ByteBuffer src)
public final int readFrom(ReadableByteChannel channel) throws IOException
IOException
public final int writeTo(WritableByteChannel dst) throws IOException
IOException
public final ByteBuffer data()
Copyright © 2005–2021 The Apache Software Foundation. All rights reserved.