final class DirectByteArrayView extends ByteArrayView
| Constructor and Description |
|---|
DirectByteArrayView(byte[] data) |
DirectByteArrayView(byte[] data,
int off,
int len) |
| Modifier and Type | Method and Description |
|---|---|
byte[] |
array()
Returns a reference to the backing array for this view.
|
ByteArrayView |
copy()
Create a new ByteArrayView which wraps a new byte[] containing a copy of
this view's data
NB: this method copies the underlying data
|
ByteArrayView |
copy(int off,
int len)
Create a new ByteArrayView which wraps a new byte[] containing a copy of
this view's data
NB: this method copies the underlying data
|
byte[] |
copyBytes()
Create a new byte[] containing a copy of this view's data.
|
byte[] |
copyBytes(int off,
int len)
Create a new byte[] containing a copy of this view's data within the provided window.
|
int |
length()
return the length of this view
NB: no data is copied when doing this
|
int |
offset()
return the offset into the backing array of this view
NB: no data is copied when doing this
|
ByteArrayView |
slice(int off,
int len)
Create a new ByteArrayView which wraps a portion of this one
NB: no data is copied when doing this
|
ByteBuffer |
view()
Create a new ByteBuffer which wraps all of this one
NB: no data is copied when doing this
|
ByteBuffer |
view(int off,
int len)
Create a new ByteBuffer which wraps a portion of this one
NB: no data is copied when doing this
|
asString, clone, compareTo, equals, get, hashCode, makeCopiedView, makeCopiedView, makeView, makeView, makeView, toStringpublic DirectByteArrayView(byte[] data)
public DirectByteArrayView(byte[] data,
int off,
int len)
public ByteArrayView slice(int off, int len)
ByteArrayViewslice in class ByteArrayViewoff - the initial offset of the window (relative to the current window)len - the length of the windowpublic ByteBuffer view(int off, int len)
ByteArrayViewview in class ByteArrayViewoff - the initial offset of the window (relative to the current window)len - the length of the windowpublic ByteBuffer view()
ByteArrayViewview in class ByteArrayViewpublic byte[] array()
ByteArrayViewByteArrayView.offset() and offset() + ByteArrayView.length().
NB: no data is copied when doing thisarray in class ByteArrayViewpublic int offset()
ByteArrayViewoffset in class ByteArrayViewpublic int length()
ByteArrayViewlength in class ByteArrayViewpublic ByteArrayView copy(int off, int len)
ByteArrayViewcopy in class ByteArrayViewoff - the initial offset of the window (relative to the current window)len - the length of the windowif you need a copy of the data in a byte[] indexed from 0 rather than offset()public ByteArrayView copy()
ByteArrayViewcopy in class ByteArrayViewif you need a copy of the data in a byte[] indexed from 0 rather than offset()public byte[] copyBytes(int off,
int len)
ByteArrayViewByteArrayView.array().
NB: this method copies the underlying datacopyBytes in class ByteArrayViewoff - the initial offset of the window (relative to the current window)len - the length of the windowpublic byte[] copyBytes()
ByteArrayViewByteArrayView.array().
NB: this method copies the underlying datacopyBytes in class ByteArrayViewCopyright © 2015–2018 Cloud Software Group, Inc.. All rights reserved.