Package com.caucho.hessian.mux
Class MuxInputStream
- java.lang.Object
-
- java.io.InputStream
-
- com.caucho.hessian.mux.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 URLprotected 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.
-
-
-
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 classjava.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 interfacejava.lang.AutoCloseable
- Specified by:
close
in interfacejava.io.Closeable
- Overrides:
close
in classjava.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
-
-