Class BinaryRecordReader

  • All Implemented Interfaces:
    IRecordReader

    public class BinaryRecordReader
    extends Object
    implements IRecordReader
    Deserializes data from the provided InputStream and constructs records via the provided IRecordBuilder. Data in the InputStream is expected to be in the HPCC Systems binary record format.
    • Constructor Detail

      • BinaryRecordReader

        public BinaryRecordReader​(InputStream is,
                                  long streamPos)
                           throws Exception
        A Binary record reader.
        Parameters:
        is - the input stream
        streamPos - the position in the stream to start reading at
        Throws:
        Exception - the exception
    • Method Detail

      • getStreamMessages

        public String getStreamMessages()
      • getStreamMessageCount

        public int getStreamMessageCount()
      • getStreamPosAfterLastRecord

        public long getStreamPosAfterLastRecord()
      • setUseDecimalForUnsigned8

        public void setUseDecimalForUnsigned8​(boolean useDecimal)
        Determines if unsigned 8 values should be parsed into BigDecimals to avoid long overflow.
        Parameters:
        useDecimal - use decimal
      • setIsIndex

        public void setIsIndex​(boolean isIdx)
        Should be set if this record reader is reading an index file.
        Parameters:
        isIdx - Is this an index file?
      • setStringProcessingFlags

        public void setStringProcessingFlags​(int flags)
        Set string processing flags.
        Parameters:
        flags - string processing flags
      • hasNext

        public boolean hasNext()
                        throws HpccFileException
        Description copied from interface: IRecordReader
        hasNext Are there more records? The first time used will trigger a remote file read.
        Specified by:
        hasNext in interface IRecordReader
        Returns:
        true if there is at least one more record
        Throws:
        HpccFileException - if there was a failure on the back end. This error is not recoverable by a retry.
      • getAvailable

        public int getAvailable()
                         throws IOException
        Returns the number of bytes available to read immediately.
        Specified by:
        getAvailable in interface IRecordReader
        Returns:
        the available
        Throws:
        IOException - Signals that an I/O exception has occurred.