com.pixelmed.scpecg

## Class SectionHeader

- java.lang.Object
- - com.pixelmed.scpecg.SectionHeader

    public class SectionHeader
    extends java.lang.Object

A class to encapsulate the header portion of an SCP-ECG section.

### Field Summary

Fields
`protected SCPTreeRecord` `tree`

### Constructor Summary

Constructors
Constructor and Description
`SectionHeader()`

### Method Summary

Methods
`long` `getByteOffset()`
`long` `getBytesRead()`
`int` `getProtocolVersionNumber()`
`byte[]` `getReservedBytes()`
`int` `getSectionCRC()`
`int` `getSectionIDNumber()`
`long` `getSectionLength()`
`int` `getSectionVersionNumber()`
`SCPTreeRecord` `getTree()` Get the contents of the header as a tree for display.
`SCPTreeRecord` `getTree(SCPTreeRecord parent)` Get the contents of the header as a tree for display, constructing it if not already done.
`long` `read(BinaryInputStream i, long byteOffset)` Read the section header from a stream.
`java.lang.String` `toString()` Dump the header as a `String`.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

### Field Detail

#### tree

    protected SCPTreeRecord tree

### Constructor Detail

#### SectionHeader

    public SectionHeader()

### Method Detail

#### getSectionCRC

    public int getSectionCRC()

#### getSectionIDNumber

    public int getSectionIDNumber()

#### getSectionLength

    public long getSectionLength()

#### getSectionVersionNumber

    public int getSectionVersionNumber()

#### getProtocolVersionNumber

    public int getProtocolVersionNumber()

#### getReservedBytes

    public byte[] getReservedBytes()

#### getBytesRead

    public long getBytesRead()

#### getByteOffset

    public long getByteOffset()

#### read

    public long read(BinaryInputStream i,
            long byteOffset)
              throws java.io.IOException

Read the section header from a stream.

Parameters:
  `i` - the input stream
  `byteOffset` - byte offset
Returns:
  the number of bytes read
Throws:
  `java.io.IOException`

#### toString

    public java.lang.String toString()

Dump the header as a `String`.

Overrides:
  `toString` in class `java.lang.Object`
Returns:
  the header as a `String`

#### getTree

    public SCPTreeRecord getTree()

Get the contents of the header as a tree for display.

Returns:
  the section as a tree, or null if not constructed

#### getTree

    public SCPTreeRecord getTree(SCPTreeRecord parent)

Get the contents of the header as a tree for display, constructing it if not already done.

Parameters:
  `parent` - the node to which this section is to be added if it needs to be created de novo
Returns:
  the header as a tree