public interface IBlockHeader
Modifier and Type | Field and Description |
---|---|
static int |
MAGIC_NUMBER
The magic number, should be the value of
magicNumber . |
Modifier and Type | Method and Description |
---|---|
int |
bytesRemaining(long position)
Gives the bytes remaining in this block (record) given a buffer position.
|
long |
firstEventStartingPosition()
Determines where the start of the first event in this block (record) is located
(bytes).
|
long |
getBufferEndingPosition()
Get the position in the buffer (bytes) of this block's last data word.
|
long |
getBufferStartingPosition()
Get the starting position in the buffer (bytes) from which this header was read--if that happened.
This is not part of the block header proper. |
java.nio.ByteOrder |
getByteOrder()
Get the byte order of the data being read.
|
CompressionType |
getCompressionType()
Get the type of data compression used.
|
int |
getEventType()
Get the type of events in block/record (see values of
DataType . |
int |
getHeaderWords()
Get the block (record) header length, in 32 bit words.
|
int |
getMagicNumber()
Get the magic number the block (record) header which should be 0xc0da0100.
|
int |
getNumber()
Get the block number for this block (record).
|
int |
getSize()
Get the size of the block (record) in 32 bit words.
|
int |
getSourceId()
Get the source ID number if in CODA online context and data is coming from ROC.
|
int |
getVersion()
Get the evio version of the block (record) header.
|
boolean |
hasDictionary()
Does this block contain an evio dictionary?
|
boolean |
hasFirstEvent()
Does this block/record contain the "first event"
(first event to be written to each file split)?
|
boolean |
isCompressed()
Is this the data in this block compressed?
|
boolean |
isLastBlock()
Is this the last block in the file or being sent over the network?
|
long |
nextBufferStartingPosition()
Determines where the start of the next block (record) header in some buffer is located (bytes).
|
void |
setBufferStartingPosition(long bufferStartingPosition)
Set the starting position in the buffer (bytes) from which this header was read--if that happened.
This is not part of the block header proper. |
java.lang.String |
toString()
Get the string representation of the block (record) header.
|
int |
write(java.nio.ByteBuffer byteBuffer)
Write myself out into a byte buffer.
|
static final int MAGIC_NUMBER
magicNumber
.int getSize()
int getNumber()
int getHeaderWords()
int getSourceId()
boolean hasFirstEvent()
true
if this record has the first event, else false
int getEventType()
DataType
.int getVersion()
int getMagicNumber()
java.nio.ByteOrder getByteOrder()
long getBufferEndingPosition()
long getBufferStartingPosition()
void setBufferStartingPosition(long bufferStartingPosition)
bufferStartingPosition
- starting position in buffer from which this header was read--if that
happened.long nextBufferStartingPosition()
long firstEventStartingPosition()
int bytesRemaining(long position) throws EvioException
bufferStartingPosition
is
being maintained properly by the reader. No block is longer than 2.1GB - 31 bits of length. This is for
practical reasons - so a block can be read into a single byte array.position
- the absolute current position in a byte buffer.EvioException
- if position out of boundsboolean hasDictionary()
true
if this block contains an evio dictionary, else false
.boolean isLastBlock()
true
if this is the last block in the file or being sent
over the network, else false
.boolean isCompressed()
true
if the data in this block is compressed, else false
.CompressionType getCompressionType()
int write(java.nio.ByteBuffer byteBuffer) throws java.nio.BufferOverflowException
byteBuffer
- the byteBuffer to write to.java.nio.BufferOverflowException
- if insufficient room to write header into buffer.java.lang.String toString()
toString
in class java.lang.Object