java.lang.Object
com.blackhillsoftware.smf.Data
- Direct Known Subclasses:
AggregateGroup.IDsnMem,BaseConfiguration.SystemFeatures,BaseConfiguration.SystemInformation,Drive.Status,Library.Status,SmfData,SmsVolume.Status,StorageGroup.Library,StorageGroup.Status,Token,VRecord
Base class to contain data for records and sections
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionData(byte[] source) Create a Data section from a byte array.Data(byte[] source, int offset, int length) Create a Data section with data copied from an existing byte arrayCreate a Data section from an existing Data object.Data(com.blackhillsoftware.smf.internal.Section source) Create a Data section from an existing Section array.Data(com.blackhillsoftware.smf.internal.Section source, int offset, int length) Create a Data section with data from an existing byte array -
Method Summary
Modifier and TypeMethodDescriptiondump()static Stringdump(byte[] data) static Stringdump(byte[] data, int offset, int length) dump(int offset, int length) static Stringdump(com.blackhillsoftware.smf.internal.Section data, int offset, int length) booleanTests equality, returns true if data arrays contain the same data, and objects are of the same type.voidextract()Copy data from this section into a new array.byte[]getBytes()Get a copy of the data in this record or sectionbyte[]getBytes(int offset, int length) Get a copy of the data in this record or section from a particular offset and lengthinthashCode()intlength()Get the length of the sectiontoString()
-
Field Details
-
EMPTY
public static final byte[] EMPTY
-
-
Constructor Details
-
Data
public Data(byte[] source, int offset, int length) Create a Data section with data copied from an existing byte array- Parameters:
source- the byte array containing the data sectionoffset- the offset of the start of the datalength- the length of the data
-
Data
public Data(com.blackhillsoftware.smf.internal.Section source, int offset, int length) Create a Data section with data from an existing byte array- Parameters:
source-offset-length-
-
Data
public Data(byte[] source) Create a Data section from a byte array.- Parameters:
source- a byte array containing a complete section
-
Data
public Data(com.blackhillsoftware.smf.internal.Section source) Create a Data section from an existing Section array.- Parameters:
source- a Section containing a complete section
-
Data
Create a Data section from an existing Data object.- Parameters:
source- a Data object
-
-
Method Details
-
extract
public void extract()Copy data from this section into a new array. This allows data from the parent record to be garbage collected while this section is alive. This can reduce memory usage if references to subsections are kept for longer than the parent record. -
length
public int length()Get the length of the section- Returns:
- int length
-
getBytes
public byte[] getBytes()Get a copy of the data in this record or section- Returns:
- A byte array with a copy of this section
-
getBytes
public byte[] getBytes(int offset, int length) Get a copy of the data in this record or section from a particular offset and length- Parameters:
offset- offset from the start of the datalength- the length of the data to be returned- Returns:
- A byte array with the bytes requested.
-
dump
-
dump
-
dump
-
dump
-
dump
-
equals
Tests equality, returns true if data arrays contain the same data, and objects are of the same type. -
hashCode
public int hashCode() -
toString
-