public interface ISerializable
ByteBuffer
of sufficient size at an arbitrary position.
This interface is implemented by the classes representing sense and response data (as well as components thereof) to SCSI requests, which are returned to the iSCSI initiator in the SCSI Response PDU's data segment.
Additional care must be taken when implementing objects consisting of several ISerializable
components, not
to overwrite the fields of another component. The advantage of this strategy, however, will be higher speed, since
unnecessary buffer-to-buffer copying is avoided.
Modifier and Type | Method and Description |
---|---|
void |
serialize(ByteBuffer byteBuffer,
int index)
Inserts a serialized representation of the object into the specified
ByteBuffer . |
int |
size()
Returns the size in bytes of the object's serialized representation.
|
void serialize(ByteBuffer byteBuffer, int index)
ByteBuffer
. The serialized object
will occupy the byte positions from index to index + size()
- 1.byteBuffer
- where to insert the serialized object representationindex
- the position of the first byte of the serialized object in the ByteBuffer
int size()
Copyright © 2013 University of Konstanz, Distributed Systems Group. All Rights Reserved.