Class SideBandInputStream

  • All Implemented Interfaces:
    java.io.Closeable, java.lang.AutoCloseable

    public class SideBandInputStream
    extends java.io.InputStream
    Unmultiplexes the data portion of a side-band channel.

    Reading from this input stream obtains data from channel 1, which is typically the bulk data stream.

    Channel 2 is transparently unpacked and "scraped" to update a progress monitor. The scraping is performed behind the scenes as part of any of the read methods offered by this stream.

    Channel 3 results in an exception being thrown, as the remote side has issued an unrecoverable error.

    Since:
    4.11
    See Also:
    SideBandOutputStream
    • Constructor Summary

      Constructors 
      Constructor Description
      SideBandInputStream​(java.io.InputStream in, ProgressMonitor progress, java.io.Writer messageStream, java.io.OutputStream outputStream)  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      private void beginTask​(int totalWorkUnits)  
      private void doProgressLine​(java.lang.String msg)  
      private void needDataPacket()  
      private void progress​(java.lang.String pkt)  
      int read()
      int read​(byte[] b, int off, int len)
      private java.lang.String readString​(int len)  
      private static java.lang.String remote​(java.lang.String msg)  
      • Methods inherited from class java.io.InputStream

        available, close, mark, markSupported, read, reset, skip
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • P_UNBOUNDED

        private static java.util.regex.Pattern P_UNBOUNDED
      • P_BOUNDED

        private static java.util.regex.Pattern P_BOUNDED
      • rawIn

        private final java.io.InputStream rawIn
      • messages

        private final java.io.Writer messages
      • out

        private final java.io.OutputStream out
      • progressBuffer

        private java.lang.String progressBuffer
      • currentTask

        private java.lang.String currentTask
      • lastCnt

        private int lastCnt
      • eof

        private boolean eof
      • channel

        private int channel
      • available

        private int available
    • Constructor Detail

      • SideBandInputStream

        SideBandInputStream​(java.io.InputStream in,
                            ProgressMonitor progress,
                            java.io.Writer messageStream,
                            java.io.OutputStream outputStream)
    • Method Detail

      • read

        public int read()
                 throws java.io.IOException
        Specified by:
        read in class java.io.InputStream
        Throws:
        java.io.IOException
      • read

        public int read​(byte[] b,
                        int off,
                        int len)
                 throws java.io.IOException
        Overrides:
        read in class java.io.InputStream
        Throws:
        java.io.IOException
      • needDataPacket

        private void needDataPacket()
                             throws java.io.IOException
        Throws:
        java.io.IOException
      • progress

        private void progress​(java.lang.String pkt)
                       throws java.io.IOException
        Throws:
        java.io.IOException
      • doProgressLine

        private void doProgressLine​(java.lang.String msg)
                             throws java.io.IOException
        Throws:
        java.io.IOException
      • beginTask

        private void beginTask​(int totalWorkUnits)
      • remote

        private static java.lang.String remote​(java.lang.String msg)
      • readString

        private java.lang.String readString​(int len)
                                     throws java.io.IOException
        Throws:
        java.io.IOException