|
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Object
|
+--java.io.InputStream
|
+--java.io.FileInputStream
|
+--java.net.SocketInputStream
| Field Summary | |
private boolean |
closing
Closes the stream. |
private boolean |
eof
|
private PlainSocketImpl |
impl
|
private Socket |
socket
|
private byte[] |
temp
|
| Fields inherited from class java.io.FileInputStream |
|
| Fields inherited from class java.io.InputStream |
|
| Constructor Summary | |
(package private) |
SocketInputStream(PlainSocketImpl impl)
Creates a new SocketInputStream. |
| Method Summary | |
int |
available()
Returns the number of bytes that can be read without blocking. |
void |
close()
Enabled: Closes this file input stream and releases any system resources associated with the 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 input stream. |
private static void |
init()
Perform class load-time initializations. |
int |
read()
Reads a single byte from the socket. |
int |
read(byte[] b)
Reads into a byte array data from the socket. |
int |
read(byte[] b,
int off,
int length)
Reads into a byte array b at offset off, length bytes of data. |
(package private) void |
setEOF(boolean eof)
|
long |
skip(long numbytes)
Skips n bytes of input. |
private int |
socketRead0(FileDescriptor fd,
byte[] b,
int off,
int len,
int timeout)
Reads into an array of bytes at the specified offset using the received socket primitive. |
| Methods inherited from class java.io.FileInputStream |
getFD |
| Methods inherited from class java.io.InputStream |
__printOn, getCryptoHash, mark, markSupported, readAvailable, reset |
| Methods inherited from class java.lang.Object |
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
private boolean eof
private PlainSocketImpl impl
private byte[] temp
private Socket socket
private boolean closing
| Constructor Detail |
SocketInputStream(PlainSocketImpl impl)
throws IOException
impl - the implemented socket input stream| Method Detail |
public final java.nio.channels.FileChannel getChannel()
FileChannel
object associated with this file input stream.
The getChannel method of SocketInputStream
returns null since it is a socket based stream.
getChannel in class FileInputStream
private int socketRead0(FileDescriptor fd,
byte[] b,
int off,
int len,
int timeout)
throws IOException
fd - the FileDescriptorb - the buffer into which the data is readoff - the start offset of the datalen - the maximum number of bytes readtimeout - the read timeout in ms
IOException
public int read(byte[] b)
throws IOException
read in class FileInputStreamb - the buffer into which the data is read
IOException
public int read(byte[] b,
int off,
int length)
throws IOException
read in class FileInputStreamb - the buffer into which the data is readoff - the start offset of the datalength - the maximum number of bytes read.
IOException
public int read()
throws IOException
read in class FileInputStream-1 if the end of the
file is reached.
IOException
public long skip(long numbytes)
throws IOException
skip in class FileInputStreamnumbytes - the number of bytes to be skipped.
IOException
public int available()
throws IOException
available in class FileInputStreamIOException
public void close()
throws IOException
FileInputStreamIf this stream has an associated channel then the channel is closed as well.
close in class FileInputStreamIOExceptionvoid setEOF(boolean eof)
protected void finalize()
finalize in class FileInputStreamjava.io.FileInputStream#close()private static void init()
|
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||