< prev index next >

src/java.base/share/classes/java/net/SocketOutputStream.java

Print this page




  34  * This stream extends FileOutputStream to implement a
  35  * SocketOutputStream. Note that this class should <b>NOT</b> be
  36  * public.
  37  *
  38  * @author      Jonathan Payne
  39  * @author      Arthur van Hoff
  40  */
  41 class SocketOutputStream extends FileOutputStream {
  42     static {
  43         init();
  44     }
  45 
  46     private AbstractPlainSocketImpl impl = null;
  47     private byte temp[] = new byte[1];
  48     private Socket socket = null;
  49 
  50     /**
  51      * Creates a new SocketOutputStream. Can only be called
  52      * by a Socket. This method needs to hang on to the owner Socket so
  53      * that the fd will not be closed.
  54      * @param impl the socket output stream inplemented
  55      */
  56     SocketOutputStream(AbstractPlainSocketImpl impl) throws IOException {
  57         super(impl.getFileDescriptor());
  58         this.impl = impl;
  59         socket = impl.getSocket();
  60     }
  61 
  62     /**
  63      * Returns the unique {@link java.nio.channels.FileChannel FileChannel}
  64      * object associated with this file output stream. </p>
  65      *
  66      * The {@code getChannel} method of {@code SocketOutputStream}
  67      * returns {@code null} since it is a socket based stream.</p>
  68      *
  69      * @return  the file channel associated with this file output stream
  70      *
  71      * @since 1.4
  72      * @spec JSR-51
  73      */
  74     public final FileChannel getChannel() {




  34  * This stream extends FileOutputStream to implement a
  35  * SocketOutputStream. Note that this class should <b>NOT</b> be
  36  * public.
  37  *
  38  * @author      Jonathan Payne
  39  * @author      Arthur van Hoff
  40  */
  41 class SocketOutputStream extends FileOutputStream {
  42     static {
  43         init();
  44     }
  45 
  46     private AbstractPlainSocketImpl impl = null;
  47     private byte temp[] = new byte[1];
  48     private Socket socket = null;
  49 
  50     /**
  51      * Creates a new SocketOutputStream. Can only be called
  52      * by a Socket. This method needs to hang on to the owner Socket so
  53      * that the fd will not be closed.
  54      * @param impl the socket output stream implemented
  55      */
  56     SocketOutputStream(AbstractPlainSocketImpl impl) throws IOException {
  57         super(impl.getFileDescriptor());
  58         this.impl = impl;
  59         socket = impl.getSocket();
  60     }
  61 
  62     /**
  63      * Returns the unique {@link java.nio.channels.FileChannel FileChannel}
  64      * object associated with this file output stream. </p>
  65      *
  66      * The {@code getChannel} method of {@code SocketOutputStream}
  67      * returns {@code null} since it is a socket based stream.</p>
  68      *
  69      * @return  the file channel associated with this file output stream
  70      *
  71      * @since 1.4
  72      * @spec JSR-51
  73      */
  74     public final FileChannel getChannel() {


< prev index next >