public abstract class ModePage extends Object implements ISerializable
MODE SENSE
SCSI commands. There are two different,
command-specific formats for MODE PAGEs - the PAGE_0 FORMAT and the SUB-PAGE FORMAT, represented by the non-abstract
children of this class, Page_0FormatModePage
and SubPageFormatModePage
, respectively.Modifier and Type | Field and Description |
---|---|
protected int |
pageLength
The number of bytes following the PAGE LENGTH field.
|
Constructor and Description |
---|
ModePage(boolean parametersSaveable,
boolean subPageFormat,
int pageCode,
int pageLength)
The abstract constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
serialize(ByteBuffer byteBuffer,
int index)
Inserts a serialized representation of the object into the specified
ByteBuffer . |
protected abstract void |
serializeModeParameters(ByteBuffer buffer,
int index) |
protected abstract void |
serializePageLength(ByteBuffer buffer,
int index)
Serializes the PAGE LENGTH field.
|
protected abstract void |
serializeSubPageCode(ByteBuffer buffer,
int index)
This method serializes the SUBPAGE CODE field, if the mode page format says this field exists (only for the
sub_page mode page format).
|
int |
size()
Returns the size in bytes of the object's serialized representation.
|
protected final int pageLength
public ModePage(boolean parametersSaveable, boolean subPageFormat, int pageCode, int pageLength)
parametersSaveable
- value of the PARAMETERS SAVEABLE bitsubPageFormat
- true
if and only if the SUB-PAGE FORMAT is to be usedpageCode
- specifies the kind of information is contained in the MODE PAGEpageLength
- the value of the PAGE LENGTH fieldpublic final void serialize(ByteBuffer byteBuffer, int index)
ISerializable
ByteBuffer
. The serialized object
will occupy the byte positions from index to index + ISerializable.size()
- 1.serialize
in interface ISerializable
byteBuffer
- where to insert the serialized object representationindex
- the position of the first byte of the serialized object in the ByteBuffer
protected abstract void serializeSubPageCode(ByteBuffer buffer, int index)
buffer
- where to insert the serialized object representationindex
- the position of the first byte of the serialized object in the ByteBuffer
protected abstract void serializePageLength(ByteBuffer buffer, int index)
buffer
- where to insert the serialized object representationindex
- the position of the first byte of the serialized object in the ByteBuffer
protected abstract void serializeModeParameters(ByteBuffer buffer, int index)
buffer
- where to insert the serialized object representationindex
- the position of the first byte of the serialized object in the ByteBuffer
public final int size()
ISerializable
size
in interface ISerializable
Copyright © 2013 University of Konstanz, Distributed Systems Group. All Rights Reserved.