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

public class Data extends Object
Base class to contain data for records and sections
  • Constructor Summary

    Constructors
    Constructor
    Description
    Data(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 array
  • Method Summary

    Modifier and Type
    Method
    Description
     
    static String
    dump(byte[] data)
     
    static String
    dump(byte[] data, int offset, int length)
     
    dump(int offset, int length)
     
    boolean
    Tests equality, returns true if data arrays contain the same data, and objects are of the same type.
    byte[]
    Get a copy of the data in this record or section
    byte[]
    getBytes(int offset, int length)
    Get a copy of the data in this record or section from a particular offset and length
    int
     
    int
    Get the length of the data
     

    Methods inherited from class java.lang.Object

    getClass, notify, notifyAll, wait, wait, wait
  • 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 SMF record
      offset - the offset of the start of the record
      length - the length of the record
    • Data

      public Data(byte[] source)
      Create a Data section from a byte array.
      Parameters:
      source - a byte array containing a complete section
  • Method Details

    • length

      public int length()
      Get the length of the data
      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 data
      length - the length of the data to be returned
      Returns:
      A byte array with the bytes requested.
    • dump

      public String dump()
    • dump

      public String dump(int offset, int length)
    • dump

      public static String dump(byte[] data)
    • dump

      public static String dump(byte[] data, int offset, int length)
    • equals

      public boolean equals(Object obj)
      Tests equality, returns true if data arrays contain the same data, and objects are of the same type.
      Overrides:
      equals in class Object
      See Also:
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object