Documentation of 'org.jlab.hipo.io.HipoRecord' Java class
HipoRecord
org.jlab.hipo.io

Class HipoRecord



  • public class HipoRecord
    extends java.lang.Object
    • Constructor Summary

      Constructors 
      Constructor and Description
      HipoRecord()
      creates and empty record ready for adding events and removing events.
      HipoRecord(byte[] array)
      Initializes a record from it's binary form and creates arrays as events that can be accessed through the interface.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      void addEvent(byte[] array)
      add an byte array into the record.
      java.nio.ByteBuffer build()
      Builds the record into a ByteBuffer includes the Header, Index Array and Event Buffer.
      byte[] buildDataBytes()
      returns one byte[] containing all the events chained together
      byte[] buildIndexBytes()
      returns a byte[] array with index for each event.
      boolean compressed()
      returns the value of the compression flag bit
      int getBytesWritten() 
      int getDataBytesSize()
      returns the total size of the all events combined
      byte[] getEvent(int index) 
      int getEventCount()
      returns number of events contained in the record
      static void main(java.lang.String[] args) 
      void reset()
      initializes an empty record.
      void setCompressionType(int type)
      sets the compression type for the record.
      void show()
      prints on the screen information about record.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • HipoRecord

        public HipoRecord()
        creates and empty record ready for adding events and removing events.
      • HipoRecord

        public HipoRecord(byte[] array)
        Initializes a record from it's binary form and creates arrays as events that can be accessed through the interface. also contains options flags such as version, type of data stored an compression flag.
        Parameters:
        array -
    • Method Detail

      • reset

        public final void reset()
        initializes an empty record. writes the identifying string "RC_G" to the first byte, this makes it easy to search in binary buffer for record start bytes in case there is a corruption in the stream.
      • addEvent

        public void addEvent(byte[] array)
        add an byte array into the record.
        Parameters:
        array -
      • getBytesWritten

        public int getBytesWritten()
      • build

        public java.nio.ByteBuffer build()
        Builds the record into a ByteBuffer includes the Header, Index Array and Event Buffer. If compression type is specified the event buffer will be compressed, and header will contain different sizes for event size compressed and event size uncompressed. NOTE: the record Header is never compressed.
        Returns:
      • setCompressionType

        public void setCompressionType(int type)
        sets the compression type for the record. 0 - no compression 1 - GZIP compression 2 - LZ4 compression
        Parameters:
        type -
      • getDataBytesSize

        public int getDataBytesSize()
        returns the total size of the all events combined
        Returns:
      • buildIndexBytes

        public byte[] buildIndexBytes()
        returns a byte[] array with index for each event.
        Returns:
      • buildDataBytes

        public byte[] buildDataBytes()
        returns one byte[] containing all the events chained together
        Returns:
      • getEventCount

        public int getEventCount()
        returns number of events contained in the record
        Returns:
      • getEvent

        public byte[] getEvent(int index)
      • show

        public void show()
        prints on the screen information about record.
      • compressed

        public boolean compressed()
        returns the value of the compression flag bit
        Returns:
        0 if compression flag is not set, 1 - if set
      • main

        public static void main(java.lang.String[] args)

DMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.