public class ByteArrayBufferImpl extends java.lang.Object implements ByteArrayBuffer
ByteArrayBuffer
.Constructor and Description |
---|
ByteArrayBufferImpl(byte[] buf)
Initializes a new
ByteArrayBufferImpl instance. |
ByteArrayBufferImpl(byte[] buffer,
int offset,
int length)
Initializes a new
ByteArrayBufferImpl instance. |
ByteArrayBufferImpl(int size)
Initializes a new
ByteArrayBufferImpl based on a newly allocated
byte array with the given size. |
Modifier and Type | Method and Description |
---|---|
byte[] |
getBuffer()
Gets the byte buffer that supports this instance.
|
int |
getLength()
Gets the length of the data in the buffer.
|
int |
getOffset()
Gets the offset in the byte buffer where the actual data starts.
|
boolean |
isInvalid()
Perform checks on the byte buffer represented by this instance and
return true if it is found to be invalid.
|
void |
setLength(int length)
Sets the length of the data in the buffer.
|
void |
setOffset(int offset)
Sets the offset of the data in the buffer.
|
void |
setOffsetLength(int offset,
int length)
Sets the offset and the length of this
ByteArrayBuffer |
public ByteArrayBufferImpl(byte[] buffer, int offset, int length)
ByteArrayBufferImpl
instance.buffer
- offset
- length
- public ByteArrayBufferImpl(int size)
ByteArrayBufferImpl
based on a newly allocated
byte array with the given size.size
- the size of the underlying byte array.public ByteArrayBufferImpl(byte[] buf)
ByteArrayBufferImpl
instance.public byte[] getBuffer()
getBuffer
in interface ByteArrayBuffer
public int getOffset()
getOffset
in interface ByteArrayBuffer
public int getLength()
getLength
in interface ByteArrayBuffer
public void setLength(int length)
setLength
in interface ByteArrayBuffer
length
- the length of the data in the buffer.public void setOffset(int offset)
setOffset
in interface ByteArrayBuffer
offset
- the offset of the data in the buffer.public void setOffsetLength(int offset, int length)
ByteArrayBuffer
offset
- the offset to set.length
- the length to set.public boolean isInvalid()
isInvalid
in interface ByteArrayBuffer
Jitsi, the OpenSource Java VoIP and Instant Messaging client.
Distributable under Apache license.