java.lang.Object | +--java.io.OutputStream | +--java.io.FileOutputStream | +--java.net.SocketOutputStream
This stream extends FileOutputStream to implement a SocketOutputStream. Note that this class should NOT be public.
void
close()
java.nio.channels.FileChannel
getChannel()
FileChannel
object associated with this file output stream.
private void
socketWrite(byte[] b,
int off,
int len)
private PlainSocketImpl impl
private byte[] temp
private Socket socket
private boolean closing
SocketOutputStream(PlainSocketImpl impl) throws IOException
impl - the socket output stream inplementedpublic final java.nio.channels.FileChannel getChannel()
FileChannel
object associated with this file output stream.
The getChannel method of SocketOutputStream
returns null since it is a socket based stream.
getChannel in class FileOutputStreamprivate void socketWrite0(FileDescriptor fd, byte[] b, int off, int len) throws IOException
fd - the FileDescriptorb - the data to be writtenoff - the start offset in the datalen - the number of bytes that are written
IOExceptionprivate void socketWrite(byte[] b, int off, int len) throws IOException
b - the data to be writtenoff - the start offset in the datalen - the number of bytes that are written
IOExceptionpublic void write(int b) throws IOException
write in class FileOutputStreamb - the data to be written
IOExceptionpublic void write(byte[] b) throws IOException
write in class FileOutputStreamb - the data to be written
IOExceptionpublic void write(byte[] b, int off, int len) throws IOException
write in class FileOutputStreamb - the data to be writtenoff - the start offset in the datalen - the number of bytes that are written
IOExceptionpublic void close() throws IOException
FileOutputStreamIf this stream has an associated channel then the channel is closed as well.
close in class FileOutputStreamprotected void finalize()
finalize in class FileOutputStreamjava.io.FileInputStream#close()private static void init()