com.caucho.hessian.mux
Class MuxInputStream

java.lang.Object
  extended by java.io.InputStream
      extended by com.caucho.hessian.mux.MuxInputStream
All Implemented Interfaces:
java.io.Closeable

public class MuxInputStream
extends java.io.InputStream

Input stream to a specific channel.


Field Summary
private  int channel
           
private  int chunkLength
           
protected  java.io.InputStream is
           
private  MuxServer server
           
private  java.lang.String url
           
 
Constructor Summary
MuxInputStream()
          Null argument constructor.
 
Method Summary
 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.
(package private)  void readToData(boolean returnOnYield)
          Reads tags, until getting data.
protected  java.lang.String readUTF()
          Reads a UTF-8 string.
(package private)  void setInputStream(java.io.InputStream is)
           
private  void skipToEnd()
          Skips data until the end of the channel.
 
Methods inherited from class java.io.InputStream
available, mark, markSupported, read, read, reset, skip
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

server

private MuxServer server

is

protected java.io.InputStream is

channel

private int channel

url

private java.lang.String url

chunkLength

private int chunkLength
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

setInputStream

void setInputStream(java.io.InputStream is)

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.io.Closeable
Overrides:
close in class java.io.InputStream
Throws:
java.io.IOException

skipToEnd

private void skipToEnd()
                throws java.io.IOException
Skips data until the end of the channel.

Throws:
java.io.IOException

readToData

void readToData(boolean returnOnYield)
          throws java.io.IOException
Reads tags, until getting data.

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


Copyright 2003-2011. All Rights Reserved.