Class ByteBufferUtils
- java.lang.Object
-
- org.apache.qpid.proton.engine.impl.ByteBufferUtils
-
public class ByteBufferUtils extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description ByteBufferUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.nio.ByteBuffernewReadableBuffer(int capacity)static java.nio.ByteBuffernewWriteableBuffer(int capacity)static intpour(java.nio.ByteBuffer source, java.nio.ByteBuffer destination)static intpourAll(java.nio.ByteBuffer source, TransportInput destinationTransportInput)Pours the contents ofsourceintodestinationTransportInput, calling the TransportInput many times if necessary.static intpourArrayToBuffer(byte[] source, int offset, int sizeRequested, java.nio.ByteBuffer destination)Assumesdestinationis ready to be written.static intpourBufferToArray(java.nio.ByteBuffer source, byte[] destination, int offset, int sizeRequested)Assumessourceis ready to be read.
-
-
-
Method Detail
-
pour
public static int pour(java.nio.ByteBuffer source, java.nio.ByteBuffer destination)- Returns:
- number of bytes poured
-
pourArrayToBuffer
public static int pourArrayToBuffer(byte[] source, int offset, int sizeRequested, java.nio.ByteBuffer destination)Assumesdestinationis ready to be written.- Returns:
- number of bytes poured which may be fewer than
sizeRequestedifdestinationhas insufficient remaining
-
pourAll
public static int pourAll(java.nio.ByteBuffer source, TransportInput destinationTransportInput) throws TransportExceptionPours the contents ofsourceintodestinationTransportInput, calling the TransportInput many times if necessary. If the TransportInput returns aTransportResultother than ok, data may remain in source.- Throws:
TransportException
-
pourBufferToArray
public static int pourBufferToArray(java.nio.ByteBuffer source, byte[] destination, int offset, int sizeRequested)Assumessourceis ready to be read.- Returns:
- number of bytes poured which may be fewer than
sizeRequestedifsourcehas insufficient remaining
-
newWriteableBuffer
public static java.nio.ByteBuffer newWriteableBuffer(int capacity)
-
newReadableBuffer
public static java.nio.ByteBuffer newReadableBuffer(int capacity)
-
-