Class PrefetchInputStreamByteReceiver

  • All Implemented Interfaces:
    org.refcodes.component.Closable, org.refcodes.component.Closable.CloseAutomaton, org.refcodes.component.ClosedAccessor, org.refcodes.component.ConnectableComponent, org.refcodes.component.ConnectableComponent.ConnectableAutomaton, org.refcodes.component.ConnectionStatusAccessor, org.refcodes.component.OpenedAccessor, Availability, ByteDestination, ByteReceiver, BytesDestination, BytesReceiver, Receivable, Skippable, TimeoutInputStreamAccessor, org.refcodes.mixin.InputStreamAccessor

    public class PrefetchInputStreamByteReceiver
    extends Object
    implements BytesReceiver
    The Class PrefetchInputStreamByteReceiver.
    Author:
    steiner
    • Constructor Detail

      • PrefetchInputStreamByteReceiver

        public PrefetchInputStreamByteReceiver​(InputStream aInputStream)
                                        throws IOException
        Instantiates a new prefetch input stream byte receiver impl.
        Parameters:
        aInputStream - the input stream
        Throws:
        IOException - the open exception
    • Method Detail

      • isClosed

        public boolean isClosed()
        Specified by:
        isClosed in interface org.refcodes.component.ClosedAccessor
      • isOpened

        public boolean isOpened()
        Specified by:
        isOpened in interface org.refcodes.component.ConnectionStatusAccessor
        Specified by:
        isOpened in interface org.refcodes.component.OpenedAccessor
      • receiveAllBytes

        public byte[] receiveAllBytes()
                               throws IOException
        Reads (receives) the all currently available data.
        Specified by:
        receiveAllBytes in interface BytesDestination
        Specified by:
        receiveAllBytes in interface BytesReceiver
        Returns:
        The according data.
        Throws:
        IOException - Thrown in case opening or accessing an open line (connection, junction, link) caused problems.
        EOFException - Signals that an end of file or end of stream has been reached unexpectedly during input.
      • getConnectionStatus

        public org.refcodes.component.ConnectionStatus getConnectionStatus()
        Specified by:
        getConnectionStatus in interface org.refcodes.component.ConnectionStatusAccessor
      • close

        public void close()
                   throws IOException
        Specified by:
        close in interface org.refcodes.component.Closable
        Throws:
        IOException
      • receiveByte

        public byte receiveByte()
                         throws IOException
        Reads (receives) the next byte, in case none byte is available, then this method blocks until one is available.
        Specified by:
        receiveByte in interface ByteDestination
        Specified by:
        receiveByte in interface BytesDestination
        Returns:
        The next byte available .
        Throws:
        IOException - Thrown in case opening or accessing an open line (connection, junction, link) caused problems.
        EOFException - Signals that an end of file or end of stream has been reached unexpectedly during input.
      • isClosable

        public boolean isClosable()
        Specified by:
        isClosable in interface org.refcodes.component.Closable.CloseAutomaton