public class SSLEngineResult extends Object
An encapsulation of the result state produced by SSLEngine
I/O calls.
A SSLEngine
provides a means for establishing secure communication sessions between two peers. SSLEngine
operations typically consume bytes from an input buffer and produce bytes in an output buffer. This class provides operational result values describing the state of the SSLEngine
, including indications of what operations are needed to finish an ongoing handshake. Lastly, it reports the number of bytes consumed and produced as a result of this operation.
SSLEngine
, SSLEngine.wrap(ByteBuffer, ByteBuffer)
, SSLEngine.unwrap(ByteBuffer, ByteBuffer)
Modifier and Type | Class and Description |
---|---|
static class |
SSLEngineResult.HandshakeStatus An |
static class |
SSLEngineResult.Status An |
public SSLEngineResult(SSLEngineResult.Status status, SSLEngineResult.HandshakeStatus handshakeStatus, int bytesConsumed, int bytesProduced)
Initializes a new instance of this class.
status
- the return value of the operation.handshakeStatus
- the current handshaking status.bytesConsumed
- the number of bytes consumed from the source ByteBufferbytesProduced
- the number of bytes placed into the destination ByteBufferIllegalArgumentException
- if the status
or handshakeStatus
arguments are null, or if bytesConsumed
or bytesProduced
is negative.public final SSLEngineResult.Status getStatus()
Gets the return value of this SSLEngine
operation.
public final SSLEngineResult.HandshakeStatus getHandshakeStatus()
Gets the handshake status of this SSLEngine
operation.
public final int bytesConsumed()
Returns the number of bytes consumed from the input buffer.
public final int bytesProduced()
Returns the number of bytes written to the output buffer.
public String toString()
Returns a String representation of this object.
© 1993–2017, Oracle and/or its affiliates. All rights reserved.
Documentation extracted from Debian's OpenJDK Development Kit package.
Licensed under the GNU General Public License, version 2, with the Classpath Exception.
Various third party code in OpenJDK is licensed under different licenses (see Debian package).
Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.