| Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||
| Page_0FormatModePage |
|
| 1.0;1 |
| 1 | package org.jscsi.target.scsi.modeSense; | |
| 2 | ||
| 3 | ||
| 4 | import java.nio.ByteBuffer; | |
| 5 | ||
| 6 | ||
| 7 | /** | |
| 8 | * Instances of this class represent MODE PAGEs using the PAGE_0 format. | |
| 9 | * | |
| 10 | * @author Andreas Ergenzinger | |
| 11 | */ | |
| 12 | public abstract class Page_0FormatModePage extends ModePage { | |
| 13 | ||
| 14 | /** | |
| 15 | * The index of the PAGE LENGTH field in the serialized representation of MODE PAGEs using the PAGE_0 format. | |
| 16 | */ | |
| 17 | private static final int PAGE_LENGTH_INDEX = 1; | |
| 18 | ||
| 19 | /** | |
| 20 | * The abstract constructor. | |
| 21 | * | |
| 22 | * @param parametersSaveable the value of the PARAMETERS SAVEABLE bit | |
| 23 | * @param pageCode determines the kind of information contained in the MODE PAGE | |
| 24 | * @param pageLength the value of the PAGE LENGTH field | |
| 25 | */ | |
| 26 | public Page_0FormatModePage (boolean parametersSaveable, int pageCode, int pageLength) { | |
| 27 | 0 | super(parametersSaveable, false,// subPageFormat |
| 28 | pageCode, pageLength); | |
| 29 | 0 | } |
| 30 | ||
| 31 | @Override | |
| 32 | protected final void serializePageLength (ByteBuffer buffer, int index) { | |
| 33 | 0 | buffer.position(index + PAGE_LENGTH_INDEX); |
| 34 | 0 | buffer.put((byte) pageLength); |
| 35 | 0 | } |
| 36 | ||
| 37 | @Override | |
| 38 | protected final void serializeSubPageCode (ByteBuffer buffer, int index) { | |
| 39 | /* | |
| 40 | * Do nothing. This method is only relevant in SubPageFormatModePage subclasses. Is only mentioned here to | |
| 41 | * prevent overwriting. | |
| 42 | */ | |
| 43 | 0 | } |
| 44 | ||
| 45 | } |