public class SSLEngineResult extends Object
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 | Description | 
|---|---|---|
| static class  | SSLEngineResult.HandshakeStatus | An  SSLEngineResultenum describing the current
 handshaking state of thisSSLEngine. | 
| static class  | SSLEngineResult.Status | An  SSLEngineResultenum describing the overall result
 of theSSLEngineoperation. | 
| Constructor | Description | 
|---|---|
| SSLEngineResult(SSLEngineResult.Status status,
               SSLEngineResult.HandshakeStatus handshakeStatus,
               int bytesConsumed,
               int bytesProduced) | Initializes a new instance of this class. | 
| Modifier and Type | Method | Description | 
|---|---|---|
| int | bytesConsumed() | Returns the number of bytes consumed from the input buffer. | 
| int | bytesProduced() | Returns the number of bytes written to the output buffer. | 
| SSLEngineResult.HandshakeStatus | getHandshakeStatus() | Gets the handshake status of this  SSLEngineoperation. | 
| SSLEngineResult.Status | getStatus() | Gets the return value of this  SSLEngineoperation. | 
| String | toString() | Returns a String representation of this object. | 
public SSLEngineResult(SSLEngineResult.Status status, SSLEngineResult.HandshakeStatus handshakeStatus, int bytesConsumed, int bytesProduced)
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()
SSLEngine operation.public final SSLEngineResult.HandshakeStatus getHandshakeStatus()
SSLEngine
 operation.public final int bytesConsumed()
public final int bytesProduced()
 Submit a bug or feature 
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
 Copyright © 1993, 2025, Oracle and/or its affiliates.  All rights reserved. Use is subject to license terms. Also see the documentation redistribution policy.