Package org.jgroups.util
Class ByteArray
java.lang.Object
org.jgroups.util.ByteArray
- All Implemented Interfaces:
SizeStreamable,Streamable
Byte array with an offset and length.
Note that the underlying byte array must not be changed as long as this instance is in use !
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncopy()byte[]getArray()byte[]getBytes()intintvoidRead the state of the current object (including superclasses) from instream Note that the input stream must not be closedintReturns the size (in bytes) of the marshalled objecttoString()voidwriteTo(DataOutput out) Write the entire state of the current object (including superclasses) to outstream.
-
Field Details
-
array
private byte[] array -
offset
private int offset -
length
private int length
-
-
Constructor Details
-
ByteArray
public ByteArray(byte[] array, int offset, int length) -
ByteArray
public ByteArray(byte[] array)
-
-
Method Details
-
getArray
public byte[] getArray() -
getOffset
public int getOffset() -
getLength
public int getLength() -
copy
-
getBytes
public byte[] getBytes() -
serializedSize
public int serializedSize()Description copied from interface:SizeStreamableReturns the size (in bytes) of the marshalled object- Specified by:
serializedSizein interfaceSizeStreamable
-
writeTo
Description copied from interface:StreamableWrite the entire state of the current object (including superclasses) to outstream. Note that the output stream must not be closed- Specified by:
writeToin interfaceStreamable- Throws:
IOException
-
readFrom
Description copied from interface:StreamableRead the state of the current object (including superclasses) from instream Note that the input stream must not be closed- Specified by:
readFromin interfaceStreamable- Throws:
IOExceptionClassNotFoundException
-
toString
-