Class BaseDecoder

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static class  BaseDecoder.BaseDecoderConnection
      The BaseDecoder.BaseDecoderConnection implements the BaseDecoder functionality in terms of a ConnectionComponent.
      • Nested classes/interfaces inherited from interface org.refcodes.io.BytesReceiver

        org.refcodes.io.BytesReceiver.ReceiverInputStream
      • Nested classes/interfaces inherited from interface org.refcodes.component.Closable

        org.refcodes.component.Closable.CloseAutomaton, org.refcodes.component.Closable.CloseBuilder<B extends org.refcodes.component.Closable.CloseBuilder<B>>
      • Nested classes/interfaces inherited from interface org.refcodes.component.ClosedAccessor

        org.refcodes.component.ClosedAccessor.ClosedMutator, org.refcodes.component.ClosedAccessor.ClosedProperty
      • Nested classes/interfaces inherited from interface org.refcodes.component.ConnectableComponent

        org.refcodes.component.ConnectableComponent.ConnectableAutomaton
      • Nested classes/interfaces inherited from interface org.refcodes.component.ConnectionStatusAccessor

        org.refcodes.component.ConnectionStatusAccessor.ConnectionStatusMutator, org.refcodes.component.ConnectionStatusAccessor.ConnectionStatusProperty
      • Nested classes/interfaces inherited from interface org.refcodes.mixin.InputStreamAccessor

        org.refcodes.mixin.InputStreamAccessor.InputStreamBuilder<B extends org.refcodes.mixin.InputStreamAccessor.InputStreamBuilder<?>>, org.refcodes.mixin.InputStreamAccessor.InputStreamMutator, org.refcodes.mixin.InputStreamAccessor.InputStreamProperty
      • Nested classes/interfaces inherited from interface org.refcodes.component.OpenedAccessor

        org.refcodes.component.OpenedAccessor.OpenedMutator, org.refcodes.component.OpenedAccessor.OpenedProperty
      • Nested classes/interfaces inherited from interface org.refcodes.io.TimeoutInputStreamAccessor

        org.refcodes.io.TimeoutInputStreamAccessor.TimeoutInputStreamBuilder<B extends org.refcodes.io.TimeoutInputStreamAccessor.TimeoutInputStreamBuilder<?>>, org.refcodes.io.TimeoutInputStreamAccessor.TimeoutInputStreamMutator, org.refcodes.io.TimeoutInputStreamAccessor.TimeoutInputStreamProperty
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      protected BaseDecoder()
      Explicit default constructor.
        BaseDecoder​(InputStream aInputStream)
      Constructs the BaseDecoder reading the data to be decoded from the provided InputStream.
        BaseDecoder​(InputStream aInputStream, BaseMetrics aBaseMetrics)
      Constructs the BaseDecoder reading the data to be decoded from the provided InputStream.
        BaseDecoder​(org.refcodes.io.BytesDestination aByteProvider)
      Constructs the BaseDecoder reading the data to be decoded from the provided BytesDestination.
        BaseDecoder​(org.refcodes.io.BytesReceiver aByteReceiver)
      Constructs the BaseDecoder reading the data to be decoded from the provided BytesReceiver.
        BaseDecoder​(org.refcodes.io.InputStreamByteReceiver aInputStreamByteReceiver, BaseMetrics aBaseMetrics)
      Constructs the BaseDecoder reading the data to be decoded from the provided InputStreamByteReceiver.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int available()
      void close()
      BaseMetrics getBaseMetrics()
      Retrieves the base codec metrics from the base codec metrics property.
      protected void open​(org.refcodes.io.BytesDestination aConnection)
      Open.
      byte[] receiveAllBytes()
      byte receiveByte()
      void setBaseMetrics​(BaseMetrics aBaseMetrics)
      Sets the base codec metrics for the base codec metrics property.
      BaseDecoder withBaseMetrics​(BaseMetrics aBaseMetrics)
      Sets the base codec metrics for the base codec metrics property.
      • Methods inherited from class org.refcodes.component.AbstractConnectableAutomaton

        getConnectionStatus, isClosable, isClosed, isOpenable, isOpened, open, setConnectionStatus
      • Methods inherited from interface org.refcodes.io.Availability

        hasAvailable
      • Methods inherited from interface org.refcodes.io.BytesDestination

        receiveBytes
      • Methods inherited from interface org.refcodes.io.BytesReceiver

        getInputStream, getInputStream, receiveBytes, receiveBytesWithin, receiveBytesWithin, receiveByteWithin, skip
      • Methods inherited from interface org.refcodes.component.Closable

        closeIn, closeQuietly, closeUnchecked
      • Methods inherited from interface org.refcodes.component.Closable.CloseAutomaton

        isClosable
      • Methods inherited from interface org.refcodes.component.ClosedAccessor

        isClosed
      • Methods inherited from interface org.refcodes.component.ConnectionStatusAccessor

        getConnectionStatus, isOpened
      • Methods inherited from interface org.refcodes.io.Skippable

        skipAvailable, skipAvailableExcept, skipAvailableTill, skipAvailableTillSilenceFor, skipAvailableTillSilenceFor, skipAvailableWithin, skipAvailableWithin
    • Constructor Detail

      • BaseDecoder

        public BaseDecoder​(org.refcodes.io.BytesDestination aByteProvider)
        Constructs the BaseDecoder reading the data to be decoded from the provided BytesDestination.
        Parameters:
        aByteProvider - The BytesDestination from which to read the data.
      • BaseDecoder

        public BaseDecoder​(org.refcodes.io.BytesReceiver aByteReceiver)
                    throws IOException
        Constructs the BaseDecoder reading the data to be decoded from the provided BytesReceiver.
        Parameters:
        aByteReceiver - The BytesReceiver from which to read the data.
        Throws:
        IOException - in case opening or accessing an open line (connection, junction, link) caused problems.
      • BaseDecoder

        public BaseDecoder​(org.refcodes.io.InputStreamByteReceiver aInputStreamByteReceiver,
                           BaseMetrics aBaseMetrics)
                    throws IOException
        Constructs the BaseDecoder reading the data to be decoded from the provided InputStreamByteReceiver.
        Parameters:
        aInputStreamByteReceiver - The InputStreamByteReceiver to use.
        aBaseMetrics - The BaseMetrics to use.
        Throws:
        IOException - in case opening or accessing an open line (connection, junction, link) caused problems.
      • BaseDecoder

        protected BaseDecoder()
        Explicit default constructor.
    • Method Detail

      • getBaseMetrics

        public BaseMetrics getBaseMetrics()
        Retrieves the base codec metrics from the base codec metrics property.
        Specified by:
        getBaseMetrics in interface BaseMetricsAccessor
        Returns:
        The base codec metrics stored by the base codec metrics property.
      • available

        public int available()
                      throws IOException
        Specified by:
        available in interface org.refcodes.io.Availability
        Specified by:
        available in interface org.refcodes.io.Skippable
        Throws:
        IOException
      • receiveAllBytes

        public byte[] receiveAllBytes()
                               throws IOException,
                                      EOFException
        Specified by:
        receiveAllBytes in interface org.refcodes.io.BytesDestination
        Specified by:
        receiveAllBytes in interface org.refcodes.io.BytesReceiver
        Throws:
        IOException
        EOFException
      • receiveByte

        public byte receiveByte()
                         throws IOException,
                                EOFException
        Specified by:
        receiveByte in interface org.refcodes.io.ByteDestination
        Specified by:
        receiveByte in interface org.refcodes.io.BytesDestination
        Throws:
        IOException
        EOFException
      • close

        public void close()
                   throws IOException
        Specified by:
        close in interface org.refcodes.component.Closable
        Overrides:
        close in class org.refcodes.component.AbstractConnectableAutomaton
        Throws:
        IOException
      • open

        protected void open​(org.refcodes.io.BytesDestination aConnection)
                     throws IOException
        Open.
        Parameters:
        aConnection - the connection
        Throws:
        IOException - the open exception