org.jlab.coda.jevio
Class SegmentHeader

java.lang.Object
  extended by org.jlab.coda.jevio.BaseStructureHeader
      extended by org.jlab.coda.jevio.SegmentHeader
All Implemented Interfaces:
java.lang.Cloneable, IEvioWriter

public final class SegmentHeader
extends BaseStructureHeader

This the the header for an evio segment structure (EvioSegment). It does not contain the raw data, just the header.

Author:
heddle

Constructor Summary
SegmentHeader()
          Null constructor.
SegmentHeader(int tag, DataType dataType)
          Constructor.
 
Method Summary
 int getHeaderLength()
          Get the length of the structure's header in ints.
 java.lang.String toString()
          Obtain a string representation of the bank header.
 int write(java.nio.ByteBuffer byteBuffer)
          Write myself out a byte buffer.
 
Methods inherited from class org.jlab.coda.jevio.BaseStructureHeader
byteValue, clone, getDataType, getDataTypeName, getDataTypeValue, getLength, getNumber, getPadding, getTag, setDataType, setLength, setNumber, setTag, shortValue
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SegmentHeader

public SegmentHeader()
Null constructor.


SegmentHeader

public SegmentHeader(int tag,
                     DataType dataType)
Constructor.

Parameters:
tag - the tag for the segment header.
dataType - the data type for the content of the segment.
Method Detail

getHeaderLength

public int getHeaderLength()
Get the length of the structure's header in ints. This includes the first header word itself (which contains the length) and in the case of banks, it also includes the second header word.

Specified by:
getHeaderLength in class BaseStructureHeader
Returns:
Get the length of the structure's header in ints.

toString

public java.lang.String toString()
Obtain a string representation of the bank header.

Overrides:
toString in class BaseStructureHeader
Returns:
a string representation of the bank header.

write

public int write(java.nio.ByteBuffer byteBuffer)
Write myself out a byte buffer. This write is relative--i.e., it uses the current position of the buffer.

Parameters:
byteBuffer - the byteBuffer to write to.
Returns:
the number of bytes written, which for a SegmentHeader is 4.