|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
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.
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()
Enabled: 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. |
java.nio.channels.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 inplementedMethod Detail |
public 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 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
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
public void write(int b) throws IOException
write
in class FileOutputStream
b
- the data to be written
IOException
public void write(byte[] b) throws IOException
write
in class FileOutputStream
b
- the data to be written
IOException
public void write(byte[] b, int off, int len) throws IOException
write
in class FileOutputStream
b
- the data to be writtenoff
- the start offset in the datalen
- the number of bytes that are written
IOException
public void close() throws IOException
FileOutputStream
If this stream has an associated channel then the channel is closed as well.
close
in class FileOutputStream
IOException
protected void finalize()
finalize
in class FileOutputStream
java.io.FileInputStream#close()
private static void init()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |