Package io.netty.channel.unix
Class IovArray
- java.lang.Object
-
- io.netty.channel.unix.IovArray
-
- All Implemented Interfaces:
io.netty.channel.ChannelOutboundBuffer.MessageProcessor
public final class IovArray extends java.lang.Object implements io.netty.channel.ChannelOutboundBuffer.MessageProcessorRepresent an array of struct array and so can be passed directly over via JNI without the need to do any more array copies. The buffers are written out directly into direct memory to match the struct iov. See alsoman writev.struct iovec { void *iov_base; size_t iov_len; };See also Efficient JNI programming IV: Wrapping native data objects.
-
-
Constructor Summary
Constructors Constructor Description IovArray()
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description booleanadd(io.netty.buffer.ByteBuf buf)Deprecated.booleanadd(io.netty.buffer.ByteBuf buf, int offset, int len)voidclear()intcount()Returns the number if iov entries.longmaxBytes()Get the maximum amount of bytes that can be added to thisIovArray.voidmaxBytes(long maxBytes)Set the maximum amount of bytes that can be added to thisIovArrayviaadd(ByteBuf, int, int)longmemoryAddress(int offset)Returns thememoryAddressfor the givenoffset.booleanprocessMessage(java.lang.Object msg)voidrelease()Release theIovArray.longsize()Returns the size in bytes
-
-
-
Method Detail
-
clear
public void clear()
-
add
@Deprecated public boolean add(io.netty.buffer.ByteBuf buf)
Deprecated.
-
add
public boolean add(io.netty.buffer.ByteBuf buf, int offset, int len)
-
count
public int count()
Returns the number if iov entries.
-
size
public long size()
Returns the size in bytes
-
maxBytes
public void maxBytes(long maxBytes)
Set the maximum amount of bytes that can be added to thisIovArrayviaadd(ByteBuf, int, int)This will not impact the existing state of the
IovArray, and only applies to subsequent calls toadd(ByteBuf).In order to ensure some progress is made at least one
ByteBufwill be accepted even if it's size exceeds this value.- Parameters:
maxBytes- the maximum amount of bytes that can be added to thisIovArray.
-
maxBytes
public long maxBytes()
Get the maximum amount of bytes that can be added to thisIovArray.- Returns:
- the maximum amount of bytes that can be added to this
IovArray.
-
memoryAddress
public long memoryAddress(int offset)
Returns thememoryAddressfor the givenoffset.
-
release
public void release()
Release theIovArray. Once release further using of it may crash the JVM!
-
processMessage
public boolean processMessage(java.lang.Object msg) throws java.lang.Exception- Specified by:
processMessagein interfaceio.netty.channel.ChannelOutboundBuffer.MessageProcessor- Throws:
java.lang.Exception
-
-