public class SSLEngineResult extends Object
SSLEngine I/O产生的结果状态的封装调用。
一个SSLEngine建立安全通信会话的两端之间提供了一种手段。SSLEngine操作通常消耗的字节从输入缓冲区和输出缓冲区产生的字节。这个类提供了操作结果值描述的SSLEngine状态,包括什么迹象表明操作都需要完成一个持续的握手。最后,它报告了这个操作的结果所消耗的字节数和产生的字节数。
SSLEngine,
SSLEngine.wrap(ByteBuffer, ByteBuffer),
SSLEngine.unwrap(ByteBuffer, ByteBuffer)
| Modifier and Type | Class and Description |
|---|---|
static class |
SSLEngineResult.HandshakeStatus
一个
SSLEngineResult枚举描述这
SSLEngine目前握手状态。
|
static class |
SSLEngineResult.Status
一个
SSLEngineResult枚举描述的
SSLEngine运行的总体结果。
|
| Constructor and Description |
|---|
SSLEngineResult(SSLEngineResult.Status status, SSLEngineResult.HandshakeStatus handshakeStatus, int bytesConsumed, int bytesProduced)
初始化该类的一个新实例。
|
| Modifier and Type | Method and Description |
|---|---|
int |
bytesConsumed()
返回从输入缓冲区消耗的字节数。
|
int |
bytesProduced()
返回写入到输出缓冲区的字节数。
|
SSLEngineResult.HandshakeStatus |
getHandshakeStatus()
得到这
SSLEngine握手状态操作。
|
SSLEngineResult.Status |
getStatus()
得到这
SSLEngine操作的返回值。
|
String |
toString()
返回此对象的字符串表示形式。
|
public SSLEngineResult(SSLEngineResult.Status status, SSLEngineResult.HandshakeStatus handshakeStatus, int bytesConsumed, int bytesProduced)
status -操作的返回值。
handshakeStatus握手。
bytesConsumed -消耗的字节从源ByteBuffer数
bytesProduced放置到目标ByteBuffer的字节数
IllegalArgumentException -如果
status或
handshakeStatus参数为空,或者
bytesConsumed或
bytesProduced是负的。
public final SSLEngineResult.Status getStatus()
SSLEngine操作的返回值。
public final SSLEngineResult.HandshakeStatus getHandshakeStatus()
SSLEngine握手状态操作。
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, 2014, Oracle and/or its affiliates. All rights reserved.