Project JXTA

net.jxta.socket
Class JxtaSocketOutputStream

java.lang.Object
  extended byjava.io.OutputStream
      extended bynet.jxta.socket.JxtaSocketOutputStream

public class JxtaSocketOutputStream
extends OutputStream

This class implements a buffered output stream. By setting up such an output stream, an application can write bytes to the underlying output stream without necessarily causing a call to the underlying system for each byte written. Data buffer is flushed to the underlaying stream, when it is full, or an explicit call to flush is made.


Field Summary
protected  byte[] buf
          Data buffer
protected  int count
          byte count in buffer
protected  JxtaSocket socket
          JxtaSocket associated with this stream
 
Constructor Summary
JxtaSocketOutputStream(JxtaSocket socket)
          Constructor for the JxtaSocketOutputStream object
JxtaSocketOutputStream(JxtaSocket socket, int size)
          Constructor for the JxtaSocketOutputStream object
 
Method Summary
 void flush()
          
 void write(byte[] b, int off, int len)
          
 void write(int b)
          
 
Methods inherited from class java.io.OutputStream
close, write
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

buf

protected byte[] buf
Data buffer


count

protected int count
byte count in buffer


socket

protected JxtaSocket socket
JxtaSocket associated with this stream

Constructor Detail

JxtaSocketOutputStream

public JxtaSocketOutputStream(JxtaSocket socket)
Constructor for the JxtaSocketOutputStream object

Parameters:
socket - JxtaSocket associated with this stream

JxtaSocketOutputStream

public JxtaSocketOutputStream(JxtaSocket socket,
                              int size)
Constructor for the JxtaSocketOutputStream object

Parameters:
socket - JxtaSocket associated with this stream
size - buffer size in bytes
Method Detail

write

public void write(int b)
           throws IOException

Throws:
IOException

write

public void write(byte[] b,
                  int off,
                  int len)
           throws IOException

Throws:
IOException

flush

public void flush()
           throws IOException

Throws:
IOException

JXTA J2SE