Class BinaryFileReader

  • All Implemented Interfaces:
    AdditionalInformationHandler, ArrayProvider, CleanUpHandler, Destroyable, GlobalInfoSupporter, LoggingLevelHandler, LoggingSupporter, OptionHandler, QuickInfoSupporter, ShallowCopySupporter<Actor>, SizeOfHandler, Stoppable, StoppableWithFeedback, VariablesInspectionHandler, VariableChangeListener, Actor, ArrayProvider, ErrorHandler, InputConsumer, OutputProducer, Serializable, Comparable

    public class BinaryFileReader
    extends AbstractTransformer
    implements ArrayProvider
    Reads a binary file and forwards the content byte by byte or as byte array.

    Input/output:
    - accepts:
       java.lang.String
       java.io.File
    - generates:
       java.lang.Byte


    -logging-level <OFF|SEVERE|WARNING|INFO|CONFIG|FINE|FINER|FINEST> (property: loggingLevel)
        The logging level for outputting errors and debugging output.
        default: WARNING
     
    -name <java.lang.String> (property: name)
        The name of the actor.
        default: BinaryFileReader
     
    -annotation <adams.core.base.BaseText> (property: annotations)
        The annotations to attach to this actor.
        default: 
     
    -skip <boolean> (property: skip)
        If set to true, transformation is skipped and the input token is just forwarded 
        as it is.
        default: false
     
    -stop-flow-on-error <boolean> (property: stopFlowOnError)
        If set to true, the flow gets stopped in case this actor encounters an error;
         useful for critical actors.
        default: false
     
    -start <long> (property: start)
        The starting position in the file (1-based index).
        default: 1
        minimum: 1
     
    -end <long> (property: end)
        The last position in the file (incl; 1-based index; <0 denotes end-of-file
        ).
        default: -1
        minimum: -1
     
    -output-array <boolean> (property: outputArray)
        If enabled, outputs the file content as byte array rather than byte by byte.
        default: false
     
    Version:
    $Revision$
    Author:
    fracpete (fracpete at waikato dot ac dot nz)
    See Also:
    Serialized Form
    • Field Detail

      • BACKUP_POSITION

        public static final String BACKUP_POSITION
        the key for storing the current position the backup.
        See Also:
        Constant Field Values
      • BACKUP_STREAM

        public static final String BACKUP_STREAM
        the key for storing the current stream the backup.
        See Also:
        Constant Field Values
      • m_Start

        protected long m_Start
        the start position.
      • m_End

        protected long m_End
        the end position.
      • m_Position

        protected long m_Position
        the current position.
      • m_ActualEnd

        protected long m_ActualEnd
        the actual last position.
      • m_CurrentFile

        protected File m_CurrentFile
        the current file to read from.
      • m_OutputArray

        protected boolean m_OutputArray
        whether to output an array instead of single items.
      • m_Data

        protected gnu.trove.list.array.TByteArrayList m_Data
        the collected data.
    • Constructor Detail

      • BinaryFileReader

        public BinaryFileReader()