Class MuxInputStream

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

    public class MuxInputStream
    extends java.io.InputStream
    Input stream to a specific channel.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected java.io.InputStream is  
    • Constructor Summary

      Constructors 
      Constructor Description
      MuxInputStream()
      Null argument constructor.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void close()
      Complete writing to the stream, closing the channel.
      int getChannel()
      Gets the channel of the connection.
      protected java.io.InputStream getInputStream()
      Gets the raw input stream.
      java.lang.String getURL()
      Returns the request's URL
      protected void init​(MuxServer server, int channel)
      Initialize the multiplexor with input and output streams.
      int read()
      Writes a data byte to the output stream.
      protected void readTag​(int tag)
      Subclasses will extend this to read values.
      protected java.lang.String readUTF()
      Reads a UTF-8 string.
      • Methods inherited from class java.io.InputStream

        available, mark, markSupported, nullInputStream, read, read, readAllBytes, readNBytes, readNBytes, reset, skip, transferTo
      • Methods inherited from class java.lang.Object

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

      • is

        protected java.io.InputStream is
    • Constructor Detail

      • MuxInputStream

        public MuxInputStream()
        Null argument constructor.
    • Method Detail

      • init

        protected void init​(MuxServer server,
                            int channel)
                     throws java.io.IOException
        Initialize the multiplexor with input and output streams.
        Throws:
        java.io.IOException
      • getInputStream

        protected java.io.InputStream getInputStream()
                                              throws java.io.IOException
        Gets the raw input stream. Clients will normally not call this.
        Throws:
        java.io.IOException
      • getChannel

        public int getChannel()
        Gets the channel of the connection.
      • getURL

        public java.lang.String getURL()
        Returns the request's URL
      • read

        public int read()
                 throws java.io.IOException
        Writes a data byte to the output stream.
        Specified by:
        read in class java.io.InputStream
        Throws:
        java.io.IOException
      • close

        public void close()
                   throws java.io.IOException
        Complete writing to the stream, closing the channel.
        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface java.io.Closeable
        Overrides:
        close in class java.io.InputStream
        Throws:
        java.io.IOException
      • readTag

        protected void readTag​(int tag)
                        throws java.io.IOException
        Subclasses will extend this to read values.
        Throws:
        java.io.IOException
      • readUTF

        protected java.lang.String readUTF()
                                    throws java.io.IOException
        Reads a UTF-8 string.
        Returns:
        the utf-8 encoded string
        Throws:
        java.io.IOException