verinec.netsim.util.net.sockets
Class SocketOutputStream

java.lang.Object
  extended by java.io.OutputStream
      extended by verinec.netsim.util.net.sockets.SocketOutputStream
All Implemented Interfaces:
Closeable, Flushable

public class SocketOutputStream
extends OutputStream

A SocketOutputStream that write it's data into a Vector and sends thisone as payload to a SocketImpl.

Version:
$Revision: 47 $
Author:
Dominik Jungo

Field Summary
private  SocketImpl impl
           
private  Logger jlogger
           
 
Constructor Summary
SocketOutputStream(SocketImpl impl)
          Constructs a new SocketOutputStream that write it's data to a SocketImpl
 
Method Summary
 void close()
           
 void flush()
          does nothing, because there is no buffer for this stream.
 void write(byte[] b)
           
 void write(byte[] b, int off, int len)
           
 void write(int b)
          sends a TCPPacket with one byte of data
 void write(int b, ILogger logger)
          sends a TCPPacket with one byte of data
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

impl

private SocketImpl impl

jlogger

private Logger jlogger
Constructor Detail

SocketOutputStream

public SocketOutputStream(SocketImpl impl)
                   throws IOException
Constructs a new SocketOutputStream that write it's data to a SocketImpl

Parameters:
impl - a SocketImpl
Throws:
IOException - if an I/O error occurs
Method Detail

flush

public void flush()
           throws IOException
does nothing, because there is no buffer for this stream.

Specified by:
flush in interface Flushable
Overrides:
flush in class OutputStream
Throws:
IOException
See Also:
OutputStream.flush()

write

public void write(int b)
           throws IOException
sends a TCPPacket with one byte of data

Specified by:
write in class OutputStream
Throws:
IOException
See Also:
OutputStream.write(int)

write

public void write(int b,
                  ILogger logger)
           throws IOException
sends a TCPPacket with one byte of data

Parameters:
b - some data
logger - a logger
Throws:
IOException - if an I/O error occurs. In particular, an IOException is thrown if the output stream is closed.
See Also:
write(int)

write

public void write(byte[] b)
           throws IOException
Overrides:
write in class OutputStream
Throws:
IOException
See Also:
OutputStream.write(byte[])

write

public void write(byte[] b,
                  int off,
                  int len)
           throws IOException
Overrides:
write in class OutputStream
Throws:
IOException
See Also:
OutputStream.write(byte[], int, int)

close

public void close()
           throws IOException
Specified by:
close in interface Closeable
Overrides:
close in class OutputStream
Throws:
IOException
See Also:
OutputStream.close()

Copyright © 2005 Verinec, DIUF