private class SSLSocketImpl.AppInputStream extends InputStream
| 限定符和类型 | 字段和说明 |
|---|---|
private boolean |
appDataIsAvailable |
private ByteBuffer |
buffer |
private boolean |
hasDepleted |
private boolean |
isClosing |
private byte[] |
oneByte |
private ReentrantLock |
readLock |
| 构造器和说明 |
|---|
AppInputStream() |
| 限定符和类型 | 方法和说明 |
|---|---|
int |
available()
Return the minimum number of bytes that can be read
without blocking.
|
private boolean |
checkEOF()
Return whether we have reached end-of-file.
|
void |
close() |
private void |
deplete()
Try the best to use up the input records so as to close the
socket gracefully, without impact the performance too much.
|
int |
read()
Read a single byte, returning -1 on non-fault EOF status.
|
int |
read(byte[] b,
int off,
int len)
Reads up to
len bytes of data from the input stream
into an array of bytes. |
private void |
readLockedDeplete()
Try to use up the input records.
|
long |
skip(long n)
Skip n bytes.
|
mark, markSupported, read, resetprivate final byte[] oneByte
private ByteBuffer buffer
private volatile boolean appDataIsAvailable
private final ReentrantLock readLock
private volatile boolean isClosing
private volatile boolean hasDepleted
public int available()
throws IOException
available 在类中 InputStreamIOExceptionpublic int read()
throws IOException
read 在类中 InputStreamIOExceptionpublic int read(byte[] b,
int off,
int len)
throws IOException
len bytes of data from the input stream
into an array of bytes.
An attempt is made to read as many as len bytes, but a
smaller number may be read. The number of bytes actually read
is returned as an integer.
If the layer above needs more data, it asks for more, so we
are responsible only for blocking to fill at most one buffer,
and returning "-1" on non-fault EOF status.read 在类中 InputStreamIOExceptionpublic long skip(long n)
throws IOException
skip 在类中 InputStreamIOExceptionpublic void close()
throws IOException
close 在接口中 Closeableclose 在接口中 AutoCloseableclose 在类中 InputStreamIOExceptionprivate boolean checkEOF()
throws IOException
IOExceptionprivate void deplete()
private void readLockedDeplete()
Copyright © 2023. All rights reserved.