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 (physical record) given a buffer position.
|
long |
firstEventStartingPosition()
Determines where the start of the first event (logical record) in this block (physical record) is located
(in bytes).
|
long |
getBufferEndingPosition()
Get the position in the buffer (in bytes) of this block's last data word.
|
long |
getBufferStartingPosition()
Get the starting position in the buffer (in 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.
|
int |
getHeaderLength()
Get the block header length, in ints.
|
int |
getMagicNumber()
Get the magic number the block (physical record) header which should be 0xc0da0100.
|
int |
getNumber()
Get the block number for this block (physical record).
|
int |
getSize()
Get the size of the block (physical record).
|
int |
getVersion()
Get the evio version of the block (physical record) header.
|
boolean |
hasDictionary()
Is this block's first event is an evio dictionary?
|
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 (physical record) header in some buffer is located (in bytes).
|
void |
setBufferStartingPosition(long bufferStartingPosition)
Set the starting position in the buffer (in bytes) from which this header was read--if that happened.
This is not part of the block header proper. |
java.lang.String |
toString()
Obtain a string representation of the block (physical record) header.
|
int |
write(java.nio.ByteBuffer byteBuffer)
Write myself out a byte buffer.
|
static final int MAGIC_NUMBER
magicNumber
.int getSize()
int getNumber()
int getHeaderLength()
int getVersion()
int getMagicNumber()
java.nio.ByteOrder getByteOrder()
long getBufferEndingPosition()
long getBufferStartingPosition()
void setBufferStartingPosition(long bufferStartingPosition)
bufferStartingPosition
- the starting position in the 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 is a byte buffer.EvioException
- if position out of boundsboolean hasDictionary()
true
if this block's first event is 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
int write(java.nio.ByteBuffer byteBuffer)
byteBuffer
- the byteBuffer to write to.java.lang.String toString()
toString
in class java.lang.Object