Package org.conscrypt
Class ConscryptEngineSocket.SSLInputStream
- java.lang.Object
-
- java.io.InputStream
-
- org.conscrypt.ConscryptEngineSocket.SSLInputStream
-
- All Implemented Interfaces:
java.io.Closeable
,java.lang.AutoCloseable
- Enclosing class:
- ConscryptEngineSocket
private final class ConscryptEngineSocket.SSLInputStream extends java.io.InputStream
Unwrap bytes read from the underlying socket.
-
-
Field Summary
Fields Modifier and Type Field Description private AllocatedBuffer
allocatedBuffer
private java.nio.ByteBuffer
fromEngine
private java.nio.ByteBuffer
fromSocket
private int
fromSocketArrayOffset
private java.lang.Object
readLock
private byte[]
singleByte
private java.io.InputStream
socketInputStream
-
Constructor Summary
Constructors Constructor Description SSLInputStream()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
available()
void
close()
private void
init()
private boolean
isHandshakeFinished()
private boolean
isHandshaking(javax.net.ssl.SSLEngineResult.HandshakeStatus status)
private int
processDataFromSocket(byte[] b, int off, int len)
int
read()
int
read(byte[] b)
int
read(byte[] b, int off, int len)
private int
readFromSocket()
private int
readUntilDataAvailable(byte[] b, int off, int len)
(package private) void
release()
private void
renegotiate()
Processes a renegotiation received from the remote peer.
-
-
-
Field Detail
-
readLock
private final java.lang.Object readLock
-
singleByte
private final byte[] singleByte
-
fromEngine
private final java.nio.ByteBuffer fromEngine
-
fromSocket
private final java.nio.ByteBuffer fromSocket
-
fromSocketArrayOffset
private final int fromSocketArrayOffset
-
allocatedBuffer
private final AllocatedBuffer allocatedBuffer
-
socketInputStream
private java.io.InputStream socketInputStream
-
-
Method Detail
-
close
public void close() throws java.io.IOException
- Specified by:
close
in interfacejava.lang.AutoCloseable
- Specified by:
close
in interfacejava.io.Closeable
- Overrides:
close
in classjava.io.InputStream
- Throws:
java.io.IOException
-
release
void release()
-
read
public int read() throws java.io.IOException
- Specified by:
read
in classjava.io.InputStream
- Throws:
java.io.IOException
-
read
public int read(byte[] b) throws java.io.IOException
- Overrides:
read
in classjava.io.InputStream
- Throws:
java.io.IOException
-
read
public int read(byte[] b, int off, int len) throws java.io.IOException
- Overrides:
read
in classjava.io.InputStream
- Throws:
java.io.IOException
-
available
public int available() throws java.io.IOException
- Overrides:
available
in classjava.io.InputStream
- Throws:
java.io.IOException
-
isHandshaking
private boolean isHandshaking(javax.net.ssl.SSLEngineResult.HandshakeStatus status)
-
readUntilDataAvailable
private int readUntilDataAvailable(byte[] b, int off, int len) throws java.io.IOException
- Throws:
java.io.IOException
-
processDataFromSocket
private int processDataFromSocket(byte[] b, int off, int len) throws java.io.IOException
- Throws:
java.io.IOException
-
isHandshakeFinished
private boolean isHandshakeFinished()
-
renegotiate
private void renegotiate() throws java.io.IOException
Processes a renegotiation received from the remote peer.- Throws:
java.io.IOException
-
init
private void init() throws java.io.IOException
- Throws:
java.io.IOException
-
readFromSocket
private int readFromSocket() throws java.io.IOException
- Throws:
java.io.IOException
-
-