public final class IovArray extends Object implements io.netty.channel.ChannelOutboundBuffer.MessageProcessor
man writev
.
struct iovec { void *iov_base; size_t iov_len; };See also Efficient JNI programming IV: Wrapping native data objects.
Constructor and Description |
---|
IovArray() |
Modifier and Type | Method and Description |
---|---|
boolean |
add(io.netty.buffer.ByteBuf buf)
Add a
ByteBuf to this IovArray . |
void |
clear() |
int |
count()
Returns the number if iov entries.
|
long |
maxBytes()
Get the maximum amount of bytes that can be added to this
IovArray via add(ByteBuf) . |
void |
maxBytes(long maxBytes)
Set the maximum amount of bytes that can be added to this
IovArray via add(ByteBuf) . |
long |
memoryAddress(int offset)
Returns the
memoryAddress for the given offset . |
boolean |
processMessage(Object msg) |
void |
release()
Release the
IovArray . |
long |
size()
Returns the size in bytes
|
public void clear()
public boolean add(io.netty.buffer.ByteBuf buf)
ByteBuf
to this IovArray
.buf
- The ByteBuf
to add.true
if the entire ByteBuf
has been added to this IovArray
. Note in the event
that ByteBuf
is a CompositeByteBuf
false
may be returned even if some of the components
have been added.public int count()
public long size()
public void maxBytes(long maxBytes)
IovArray
via add(ByteBuf)
.
This will not impact the existing state of the IovArray
, and only applies to subsequent calls to
add(ByteBuf)
.
In order to ensure some progress is made at least one ByteBuf
will be accepted even if it's size exceeds
this value.
maxBytes
- the maximum amount of bytes that can be added to this IovArray
via add(ByteBuf)
.public long maxBytes()
IovArray
via add(ByteBuf)
.IovArray
via add(ByteBuf)
.public long memoryAddress(int offset)
memoryAddress
for the given offset
.public void release()
IovArray
. Once release further using of it may crash the JVM!Copyright © 2008–2018 The Netty Project. All rights reserved.