Save This Page
Home » openjdk-7 » java » net » [javadoc | source]
java.net
class: SocketOutputStream [javadoc | source]
java.lang.Object
   java.io.OutputStream
      java.io.FileOutputStream
         java.net.SocketOutputStream

All Implemented Interfaces:
    Flushable, Closeable

This stream extends FileOutputStream to implement a SocketOutputStream. Note that this class should NOT be public.
Constructor:
 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.
    Parameters:
    impl - the socket output stream inplemented
Method from java.net.SocketOutputStream Summary:
close,   finalize,   getChannel,   write,   write,   write
Methods from java.io.FileOutputStream:
close,   finalize,   getChannel,   getFD,   write,   write,   write
Methods from java.io.OutputStream:
close,   flush,   write,   write,   write
Methods from java.lang.Object:
clone,   equals,   finalize,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from java.net.SocketOutputStream 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.