Class Header

java.lang.Object
org.medcare.igtl.util.Header

public class Header extends Object
** For reading/writing OpenIGTLink headers
  • Field Details

    • LENGTH

      public static int LENGTH
  • Constructor Details

    • Header

      public Header(long version, String _type, String _name, long timestamp, long body_size, long crc)
      ** Destination Constructor **
      Parameters:
      version - ; // Version number unsigned int 16bits
      _type - ; // Type name of data char 12 bits
      _name - ; // Unique device name char 20 bits
      timestamp - ; // TimeStamp or 0 if unused unsigned int 64 bits
      body_size - ; // Size of body in bytes unsigned int 64 bits
      crc - ; // 64 bit CRC for body data unsigned int 64 bits
    • Header

      public Header(long version, String dataType, String deviceName, byte[] body)
      ** Destination Constructor **
      Parameters:
      version - ; // Version number unsigned int 16bits
      dataType - ; // Type name of data char 12 bits
      deviceName - ; // Unique device name char 20 bits
      body - ; // body in bytes
    • Header

      public Header(byte[] bytes)
      ** Destination Constructor **
      Parameters:
      bytes - bytes doit contenir 58 bytes of the header
  • Method Details

    • getVersion

      public long getVersion()
      ** Version number. **
      Returns:
      The current version of the bytesArray
    • getDataType

      public String getDataType()
      ** Type name of data **
      Returns:
      The type of the device
    • getDeviceName

      public String getDeviceName()
      ** Unique device name. **
      Returns:
      The current name of the device
    • getTimeStamp

      public static double getTimeStamp()
      ** TimeStamp or 0 if unused. **
      Returns:
      The time stamp at the creation of the header
    • getBody_size

      public long getBody_size()
      ** Size of body in bytes. **
      Returns:
      The current body_size of the bytesArray
    • getCrc

      public long getCrc()
      ** 64 bit CRC for body data. **
      Returns:
      The current crc of the bytesArray
    • getBytesArray

      public BytesArray getBytesArray()
      ** ByteArray which contain header bytes. **
      Returns:
      The current bytesArray
    • getBytes

      public byte[] getBytes()
      ** this header bytes. **
      Returns:
      A copy of the byte array currently in the bytesArray (as-is)
    • toString

      public String toString()
      Overrides:
      toString in class Object