|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.io.OutputStream
java.io.FileOutputStream
java.net.SocketOutputStream
This stream extends FileOutputStream to implement a SocketOutputStream. Note that this class should NOT be public.
| Field Summary | |
private boolean |
closing
Closes the stream. |
private PlainSocketImpl |
impl
|
private Socket |
socket
|
private byte[] |
temp
|
| Fields inherited from class java.io.FileOutputStream |
|
| Constructor Summary | |
(package private) |
SocketOutputStream(PlainSocketImpl impl)
Creates a new SocketOutputStream. |
| Method Summary | |
void |
close()
Closes this file output stream and releases any system resources associated with this stream. |
protected void |
finalize()
Overrides finalize, the fd is closed by the Socket. |
FileChannel |
getChannel()
Returns the unique FileChannel
object associated with this file output stream. |
private static void |
init()
Perform class load-time initializations. |
private void |
socketWrite(byte[] b,
int off,
int len)
Writes to the socket with appropriate locking of the FileDescriptor. |
private void |
socketWrite0(FileDescriptor fd,
byte[] b,
int off,
int len)
Writes to the socket. |
void |
write(byte[] b)
Writes the contents of the buffer b to the socket. |
void |
write(byte[] b,
int off,
int len)
Writes length bytes from buffer b starting at offset len. |
void |
write(int b)
Writes a byte to the socket. |
| Methods inherited from class java.io.FileOutputStream |
getFD |
| Methods inherited from class java.io.OutputStream |
flush |
| Methods inherited from class java.lang.Object |
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
private PlainSocketImpl impl
private byte[] temp
private Socket socket
private boolean closing
| Constructor Detail |
SocketOutputStream(PlainSocketImpl impl)
throws IOException
impl - the socket output stream inplemented| Method Detail |
public final 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 FileOutputStream
private 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
IOException - If an I/O error has occurred.
private 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
IOException - If an I/O error has occurred.
public void write(int b)
throws IOException
write in class FileOutputStreamb - the data to be written
IOException - If an I/O error has occurred.
public void write(byte[] b)
throws IOException
write in class FileOutputStreamb - the data to be written
SocketException - If an I/O error has occurred.
IOException - if an I/O error occurs.
public 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
SocketException - If an I/O error has occurred.
IOException - if an I/O error occurs.
public void close()
throws IOException
FileOutputStreamIf this stream has an associated channel then the channel is closed as well.
close in class FileOutputStreamIOException - if an I/O error occurs.protected void finalize()
finalize in class FileOutputStreamFileInputStream.close()private static void init()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||