|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.kuka.comm.codec.bytebuffer.ByteBufferUtils
public final class ByteBufferUtils
This is a helper class that provides various utility functions for dealing with the ByteBuffer class.
Especially, it contains replacements for the standard ByteBuffer.slice() method, which in its original
version ignores the byte order. The slice methods in this helper class will pass the byte order to the newly created
view.
| Method Summary | |
|---|---|
static ByteBuffer |
slice(ByteBuffer bb)
Provides a view as a subsequence of a ByteBuffer. |
static ByteBuffer |
slice(ByteBuffer bb,
int begin)
Provides a view as a subsequence of a ByteBuffer. |
static ByteBuffer |
slice(ByteBuffer bb,
int begin,
int end)
Provides a view as a subsequence of a ByteBuffer. |
static ByteBuffer |
sliceLen(ByteBuffer bb,
int begin,
int length)
Provides a view as a subsequence of a ByteBuffer. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static ByteBuffer slice(ByteBuffer bb,
int begin,
int end)
ByteBuffer. It behaves comparable to the standard
ByteBuffer.slice() method, but the beginning and end of the slice can be be explicitly provided. The
returned ByteBuffer will respect the same byte order as the ByteBuffer from which it
has been created.
bb - the byte buffer of which a slice should be createdbegin - the position of the first bye of the slice (0 is the first byte)end - the position of the byte after the slice (the first byte after the end of the slice). The maximum
allowed value is the length of bb.
public static ByteBuffer sliceLen(ByteBuffer bb,
int begin,
int length)
ByteBuffer. It behaves comparable to the standard
ByteBuffer.slice() method, but the beginning and the length of the slice can be be explicitly provided.
The returned ByteBuffer will respect the same byte order as the ByteBuffer from which
it has been created.
bb - the byte buffer of which a slice should be createdbegin - the position of the first bye of the slice (0 is the first byte)length - the length of the slice in bytes
public static ByteBuffer slice(ByteBuffer bb,
int begin)
ByteBuffer. It behaves comparable to the standard
ByteBuffer.slice() method, but the beginning of the slice can be be explicitly provided. The slice will
extend until the end of the original byte buffer. The returned ByteBuffer will respect the same byte
order as the ByteBuffer from which it has been created.
bb - the byte buffer of which a slice should be createdbegin - the position of the first bye of the slice (0 is the first byte)
public static ByteBuffer slice(ByteBuffer bb)
ByteBuffer. It behaves comparable to the standard
ByteBuffer.slice() method, except that the returned ByteBuffer will respect the same byte
order as the ByteBuffer from which it has been created.
bb - the byte buffer of which a slice should be created
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||