com.caucho.hessian.mux

Class MuxOutputStream


public class MuxOutputStream
extends OutputStream

Output stream to a specific channel.

Field Summary

private int
channel
private OutputStream
os
private MuxServer
server

Constructor Summary

MuxOutputStream()
Null argument constructor.

Method Summary

void
close()
Complete writing to the stream, closing the channel.
void
flush()
Flush data to the output stream.
int
getChannel()
Gets the channel of the connection.
protected OutputStream
getOutputStream()
Gets the raw output stream.
protected void
init(MuxServer server, int channel)
Initialize the multiplexor with input and output streams.
void
write(byte[] buffer, int offset, int length)
Writes data to the output stream.
void
write(int ch)
Writes a data byte to the output stream.
void
writeURL(String url)
Writes a URL to the stream.
protected void
writeUTF(int code, String string)
Writes a UTF-8 string.
void
yield()
Flush data to the output stream.

Field Details

channel

private int channel

os

private OutputStream os

server

private MuxServer server

Constructor Details

MuxOutputStream

public MuxOutputStream()
Null argument constructor.

Method Details

close

public void close()
            throws IOException
Complete writing to the stream, closing the channel.

flush

public void flush()
            throws IOException
Flush data to the output stream.

getChannel

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

getOutputStream

protected OutputStream getOutputStream()
            throws IOException
Gets the raw output stream. Clients will normally not call this.

init

protected void init(MuxServer server,
                    int channel)
            throws IOException
Initialize the multiplexor with input and output streams.

write

public void write(byte[] buffer,
                  int offset,
                  int length)
            throws IOException
Writes data to the output stream.

write

public void write(int ch)
            throws IOException
Writes a data byte to the output stream.

writeURL

public void writeURL(String url)
            throws IOException
Writes a URL to the stream.

writeUTF

protected void writeUTF(int code,
                        String string)
            throws IOException
Writes a UTF-8 string.
Parameters:
code - the HMUX code identifying the string
string - the string to write

yield

public void yield()
            throws IOException
Flush data to the output stream.