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.