This stream extends FileOutputStream to implement a
SocketOutputStream. Note that this class should
be
public.
| Method from java.net.SocketOutputStream Detail: |
public void close() throws IOException {
// Prevent recursion. See BugId 4484411
if (closing)
return;
closing = true;
if (socket != null) {
if (!socket.isClosed())
socket.close();
} else
impl.close();
closing = false;
}
|
protected void finalize() {
}
Overrides finalize, the fd is closed by the Socket. |
public final FileChannel getChannel() {
return null;
}
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 {
temp[0] = (byte)b;
socketWrite(temp, 0, 1);
}
Writes a byte to the socket. |
public void write(byte[] b) throws IOException {
socketWrite(b, 0, b.length);
}
Writes the contents of the buffer b to the socket. |
public void write(byte[] b,
int off,
int len) throws IOException {
socketWrite(b, off, len);
}
Writes length bytes from buffer b starting at
offset len. |