Stay organized with collections
Save and categorize content based on your preferences.
SSLEngineResult
open class SSLEngineResult
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.
Summary
Nested classes |
|
An SSLEngineResult enum describing the current handshaking state of this SSLEngine .
|
|
An SSLEngineResult enum describing the overall result of the SSLEngine operation.
|
Public constructors |
Initializes a new instance of this class.
|
Public methods |
Int |
Returns the number of bytes consumed from the input buffer.
|
Int |
Returns the number of bytes written to the output buffer.
|
SSLEngineResult.HandshakeStatus! |
Gets the handshake status of this SSLEngine operation.
|
SSLEngineResult.Status! |
Gets the return value of this SSLEngine operation.
|
open String |
Returns a String representation of this object.
|
Public constructors
SSLEngineResult
SSLEngineResult(
status: SSLEngineResult.Status!,
handshakeStatus: SSLEngineResult.HandshakeStatus!,
bytesConsumed: Int,
bytesProduced: Int)
Initializes a new instance of this class.
Parameters |
status |
SSLEngineResult.Status!: the return value of the operation. |
handshakeStatus |
SSLEngineResult.HandshakeStatus!: the current handshaking status. |
bytesConsumed |
Int: the number of bytes consumed from the source ByteBuffer |
bytesProduced |
Int: the number of bytes placed into the destination ByteBuffer |
Exceptions |
java.lang.IllegalArgumentException |
if the status or handshakeStatus arguments are null, or if bytesConsumed or bytesProduced is negative. |
Public methods
bytesConsumed
fun bytesConsumed(): Int
Returns the number of bytes consumed from the input buffer.
Return |
Int |
the number of bytes consumed. |
bytesProduced
fun bytesProduced(): Int
Returns the number of bytes written to the output buffer.
Return |
Int |
the number of bytes produced |
toString
open fun toString(): String
Returns a String representation of this object.
Return |
String |
a string representation of the object. |
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-02-10 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-02-10 UTC."],[],[],null,["# SSLEngineResult\n\nAdded in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)\n\nSSLEngineResult\n===============\n\n```\nopen class SSLEngineResult\n```\n\n|---|------------------------------------|\n| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html) ||\n| ↳ | [javax.net.ssl.SSLEngineResult](#) |\n\nAn encapsulation of the result state produced by `SSLEngine` I/O calls.\n\nA `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.\n\nSummary\n-------\n\n| Nested classes ||\n|---|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| | [HandshakeStatus](/reference/kotlin/javax/net/ssl/SSLEngineResult.HandshakeStatus) An `SSLEngineResult` enum describing the current handshaking state of this `SSLEngine`. |\n| | [Status](/reference/kotlin/javax/net/ssl/SSLEngineResult.Status) An `SSLEngineResult` enum describing the overall result of the `SSLEngine` operation. |\n\n| Public constructors ||\n|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---|\n| [SSLEngineResult](#SSLEngineResult(javax.net.ssl.SSLEngineResult.Status,%20javax.net.ssl.SSLEngineResult.HandshakeStatus,%20kotlin.Int,%20kotlin.Int))`(`status:` `[SSLEngineResult.Status](/reference/kotlin/javax/net/ssl/SSLEngineResult.Status)!`, `handshakeStatus:` `[SSLEngineResult.HandshakeStatus](/reference/kotlin/javax/net/ssl/SSLEngineResult.HandshakeStatus)!`, `bytesConsumed:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`, `bytesProduced:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`)` Initializes a new instance of this class. |\n\n| Public methods ||\n|-----------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------|\n| [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [bytesConsumed](#bytesConsumed())`()` Returns the number of bytes consumed from the input buffer. |\n| [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [bytesProduced](#bytesProduced())`()` Returns the number of bytes written to the output buffer. |\n| [SSLEngineResult.HandshakeStatus](/reference/kotlin/javax/net/ssl/SSLEngineResult.HandshakeStatus)! | [getHandshakeStatus](#getHandshakeStatus())`()` Gets the handshake status of this `SSLEngine` operation. |\n| [SSLEngineResult.Status](/reference/kotlin/javax/net/ssl/SSLEngineResult.Status)! | [getStatus](#getStatus())`()` Gets the return value of this `SSLEngine` operation. |\n| open [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | [toString](#toString())`()` Returns a String representation of this object. |\n\nPublic constructors\n-------------------\n\n### SSLEngineResult\n\nAdded in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nSSLEngineResult(\n status: SSLEngineResult.Status!, \n handshakeStatus: SSLEngineResult.HandshakeStatus!, \n bytesConsumed: Int, \n bytesProduced: Int)\n```\n\nInitializes a new instance of this class.\n\n| Parameters ||\n|-------------------|----------------------------------------------------------------------------------------------------------------------------------------|\n| `status` | [SSLEngineResult.Status](/reference/kotlin/javax/net/ssl/SSLEngineResult.Status)!: the return value of the operation. |\n| `handshakeStatus` | [SSLEngineResult.HandshakeStatus](/reference/kotlin/javax/net/ssl/SSLEngineResult.HandshakeStatus)!: the current handshaking status. |\n| `bytesConsumed` | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html): the number of bytes consumed from the source ByteBuffer |\n| `bytesProduced` | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html): the number of bytes placed into the destination ByteBuffer |\n\n| Exceptions ||\n|--------------------------------------|----------------------------------------------------------------------------------------------------------------|\n| `java.lang.IllegalArgumentException` | if the `status` or `handshakeStatus` arguments are null, or if `bytesConsumed` or `bytesProduced` is negative. |\n\nPublic methods\n--------------\n\n### bytesConsumed\n\nAdded in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nfun bytesConsumed(): Int\n```\n\nReturns the number of bytes consumed from the input buffer.\n\n| Return ||\n|----------------------------------------------------------------------------|-------------------------------|\n| [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | the number of bytes consumed. |\n\n### bytesProduced\n\nAdded in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nfun bytesProduced(): Int\n```\n\nReturns the number of bytes written to the output buffer.\n\n| Return ||\n|----------------------------------------------------------------------------|------------------------------|\n| [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | the number of bytes produced |\n\n### getHandshakeStatus\n\nAdded in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nfun getHandshakeStatus(): SSLEngineResult.HandshakeStatus!\n```\n\nGets the handshake status of this `SSLEngine` operation.\n\n| Return ||\n|-----------------------------------------------------------------------------------------------------|----------------------|\n| [SSLEngineResult.HandshakeStatus](/reference/kotlin/javax/net/ssl/SSLEngineResult.HandshakeStatus)! | the handshake status |\n\n### getStatus\n\nAdded in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nfun getStatus(): SSLEngineResult.Status!\n```\n\nGets the return value of this `SSLEngine` operation.\n\n| Return ||\n|-----------------------------------------------------------------------------------|------------------|\n| [SSLEngineResult.Status](/reference/kotlin/javax/net/ssl/SSLEngineResult.Status)! | the return value |\n\n### toString\n\nAdded in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nopen fun toString(): String\n```\n\nReturns a String representation of this object.\n\n| Return ||\n|----------------------------------------------------------------------------------|----------------------------------------|\n| [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | a string representation of the object. |"]]