# SSLEngineResult

public class **SSLEngineResult** extends [Object](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html)  
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.

##### See Also

- `https://developers.google.com/j2objc/javadoc/jre/reference/javax/net/ssl/SSLEngine.html`
- `https://developers.google.com/j2objc/javadoc/jre/reference/javax/net/ssl/SSLEngine.html#wrap(java.nio.ByteBuffer,%20java.nio.ByteBuffer)`
- `https://developers.google.com/j2objc/javadoc/jre/reference/javax/net/ssl/SSLEngine.html#unwrap(java.nio.ByteBuffer,%20java.nio.ByteBuffer)`

### Nested Class Summary

|---|---|---|---|
| enum | [SSLEngineResult.HandshakeStatus](https://developers.google.com/j2objc/javadoc/jre/reference/javax/net/ssl/SSLEngineResult.HandshakeStatus.html) || An `SSLEngineResult` enum describing the current handshaking state of this `SSLEngine`. |
| enum | [SSLEngineResult.Status](https://developers.google.com/j2objc/javadoc/jre/reference/javax/net/ssl/SSLEngineResult.Status.html) || An `SSLEngineResult` enum describing the overall result of the `SSLEngine` operation. |

### Public Constructor Summary

|---|---|
|   | [SSLEngineResult](https://developers.google.com/j2objc/javadoc/jre/reference/javax/net/ssl/SSLEngineResult.html#SSLEngineResult(javax.net.ssl.SSLEngineResult.Status,%20javax.net.ssl.SSLEngineResult.HandshakeStatus,%20int,%20int))([SSLEngineResult.Status](https://developers.google.com/j2objc/javadoc/jre/reference/javax/net/ssl/SSLEngineResult.Status.html) status, [SSLEngineResult.HandshakeStatus](https://developers.google.com/j2objc/javadoc/jre/reference/javax/net/ssl/SSLEngineResult.HandshakeStatus.html) handshakeStatus, int bytesConsumed, int bytesProduced) Initializes a new instance of this class. |

### Public Method Summary

|---|---|
| final int | [bytesConsumed](https://developers.google.com/j2objc/javadoc/jre/reference/javax/net/ssl/SSLEngineResult.html#bytesConsumed())() Returns the number of bytes consumed from the input buffer. |
| final int | [bytesProduced](https://developers.google.com/j2objc/javadoc/jre/reference/javax/net/ssl/SSLEngineResult.html#bytesProduced())() Returns the number of bytes written to the output buffer. |
| final [SSLEngineResult.HandshakeStatus](https://developers.google.com/j2objc/javadoc/jre/reference/javax/net/ssl/SSLEngineResult.HandshakeStatus.html) | [getHandshakeStatus](https://developers.google.com/j2objc/javadoc/jre/reference/javax/net/ssl/SSLEngineResult.html#getHandshakeStatus())() Gets the handshake status of this `SSLEngine` operation. |
| final [SSLEngineResult.Status](https://developers.google.com/j2objc/javadoc/jre/reference/javax/net/ssl/SSLEngineResult.Status.html) | [getStatus](https://developers.google.com/j2objc/javadoc/jre/reference/javax/net/ssl/SSLEngineResult.html#getStatus())() Gets the return value of this `SSLEngine` operation. |
| [String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) | [toString](https://developers.google.com/j2objc/javadoc/jre/reference/javax/net/ssl/SSLEngineResult.html#toString())() Returns a String representation of this object. |

### Inherited Method Summary

From class [java.lang.Object](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html)

|---|---|
| [Object](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html) | [clone](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#clone())() Creates and returns a copy of this `Object`. |
| boolean | [equals](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#equals(java.lang.Object))([Object](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html) obj) Compares this instance with the specified object and indicates if they are equal. |
| void | [finalize](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#finalize())() Invoked when the garbage collector has detected that this instance is no longer reachable. |
| final [Class](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Class.html)\<?\> | [getClass](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#getClass())() Returns the unique instance of `https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Class.html` that represents this object's class. |
| int | [hashCode](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#hashCode())() Returns an integer hash code for this object. |
| final void | [notify](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#notify())() Causes a thread which is waiting on this object's monitor (by means of calling one of the `wait()` methods) to be woken up. |
| final void | [notifyAll](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#notifyAll())() Causes all threads which are waiting on this object's monitor (by means of calling one of the `wait()` methods) to be woken up. |
| [String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) | [toString](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#toString())() Returns a string containing a concise, human-readable description of this object. |
| final void | [wait](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#wait(long,%20int))(long timeout, int nanos) Causes the calling thread to wait until another thread calls the `notify()` or `notifyAll()` method of this object or until the specified timeout expires. |
| final void | [wait](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#wait(long))(long timeout) Causes the calling thread to wait until another thread calls the `notify()` or `notifyAll()` method of this object or until the specified timeout expires. |
| final void | [wait](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#wait())() Causes the calling thread to wait until another thread calls the `notify()` or `notifyAll()` method of this object. |

## Public Constructors

#### public
**SSLEngineResult**
([SSLEngineResult.Status](https://developers.google.com/j2objc/javadoc/jre/reference/javax/net/ssl/SSLEngineResult.Status.html) status, [SSLEngineResult.HandshakeStatus](https://developers.google.com/j2objc/javadoc/jre/reference/javax/net/ssl/SSLEngineResult.HandshakeStatus.html) handshakeStatus, int bytesConsumed, int bytesProduced)

Initializes a new instance of this class.

##### Parameters

| status | the return value of the operation. |
| handshakeStatus | the current handshaking status. |
| bytesConsumed | the number of bytes consumed from the source ByteBuffer |
| bytesProduced | the number of bytes placed into the destination ByteBuffer |
|---|---|

##### Throws

| [IllegalArgumentException](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/IllegalArgumentException.html) | if the `status` or `handshakeStatus` arguments are null, or if `bytesConsumed` or `bytesProduced` is negative. |
|---|---|

## Public Methods

#### public final int
**bytesConsumed**
()

Returns the number of bytes consumed from the input buffer.

##### Returns

- the number of bytes consumed.

#### public final int
**bytesProduced**
()

Returns the number of bytes written to the output buffer.

##### Returns

- the number of bytes produced

#### public final [SSLEngineResult.HandshakeStatus](https://developers.google.com/j2objc/javadoc/jre/reference/javax/net/ssl/SSLEngineResult.HandshakeStatus.html)
**getHandshakeStatus**
()

Gets the handshake status of this `SSLEngine`
operation.

##### Returns

- the handshake status

#### public final [SSLEngineResult.Status](https://developers.google.com/j2objc/javadoc/jre/reference/javax/net/ssl/SSLEngineResult.Status.html)
**getStatus**
()

Gets the return value of this `SSLEngine` operation.

##### Returns

- the return value

#### public [String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html)
**toString**
()

Returns a String representation of this object.

##### Returns

- a printable representation of this object.