Save This Page
Home » openjdk-7 » java » net » [javadoc | source]
class: SocketOutputStream [javadoc | source]

All Implemented Interfaces:
    Flushable, Closeable

This stream extends FileOutputStream to implement a SocketOutputStream. Note that this class should NOT be public.
 SocketOutputStream(AbstractPlainSocketImpl impl) throws IOException 
    Creates a new SocketOutputStream. Can only be called by a Socket. This method needs to hang on to the owner Socket so that the fd will not be closed.
    impl - the socket output stream inplemented
Method from Summary:
close,   finalize,   getChannel,   write,   write,   write
Methods from
close,   finalize,   getChannel,   getFD,   write,   write,   write
Methods from
close,   flush,   write,   write,   write
Methods from java.lang.Object:
clone,   equals,   finalize,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from Detail:
 public  void close() throws IOException 
 protected  void finalize() 
    Overrides finalize, the fd is closed by the Socket.
 public final FileChannel getChannel() 
    Returns the unique FileChannel object associated with this file output stream.

    The getChannel method of SocketOutputStream returns null since it is a socket based stream.

 public  void write(int b) throws IOException 
    Writes a byte to the socket.
 public  void write(byte[] b) throws IOException 
    Writes the contents of the buffer b to the socket.
 public  void write(byte[] b,
    int off,
    int len) throws IOException 
    Writes length bytes from buffer b starting at offset len.