Package org.medcare.igtl.util
Class Header
java.lang.Object
org.medcare.igtl.util.Header
** For reading/writing OpenIGTLink headers
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionlong
** Size of body in bytes.byte[]
getBytes()
** this header bytes.** ByteArray which contain header bytes.long
getCrc()
** 64 bit CRC for body data.** Type name of data **** Unique device name.static double
** TimeStamp or 0 if unused.long
** Version number.toString()
-
Field Details
-
LENGTH
public static int LENGTH
-
-
Constructor Details
-
Header
** Destination Constructor **- Parameters:
version
- ; // Version number unsigned int 16bits_type
- ; // Type name of data char 12 bits_name
- ; // Unique device name char 20 bitstimestamp
- ; // TimeStamp or 0 if unused unsigned int 64 bitsbody_size
- ; // Size of body in bytes unsigned int 64 bitscrc
- ; // 64 bit CRC for body data unsigned int 64 bits
-
Header
** Destination Constructor **- Parameters:
version
- ; // Version number unsigned int 16bitsdataType
- ; // Type name of data char 12 bitsdeviceName
- ; // Unique device name char 20 bitsbody
- ; // 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
** Type name of data **- Returns:
- The type of the device
-
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
** 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
-