FileDocCategorySizeDatePackage
SSLEngineResult.javaAPI DocAndroid 1.5 API6480Wed May 06 22:41:06 BST 2009javax.net.ssl

SSLEngineResult

public class SSLEngineResult extends Object
The result object describing the state of the {@code SSLEngine} produced by the {@code wrap()} and {@code unwrap()} operations.
since
Android 1.0

Fields Summary
private final Status
status
private final HandshakeStatus
handshakeStatus
private final int
bytesConsumed
private final int
bytesProduced
Constructors Summary
public SSLEngineResult(Status status, HandshakeStatus handshakeStatus, int bytesConsumed, int bytesProduced)
Creates a new {@code SSLEngineResult} instance with the specified state values.

param
status the return value of the {@code SSLEngine} operation.
param
handshakeStatus the status of the current handshake
param
bytesConsumed the number of bytes retrieved from the source buffer(s).
param
bytesProduced the number of bytes transferred to the destination buffer(s).
throws
IllegalArgumentException if {@code status} or {@code handshakeStatus} is {@code null}, or if {@code bytesConsumed} or {@code bytesProduces} are negative.
since
Android 1.0

        if (status == null) {
            throw new IllegalArgumentException("status is null");
        }
        if (handshakeStatus == null) {
            throw new IllegalArgumentException("handshakeStatus is null");
        }
        if (bytesConsumed < 0) {
            throw new IllegalArgumentException("bytesConsumed is negative");
        }
        if (bytesProduced < 0) {
            throw new IllegalArgumentException("bytesProduced is negative");
        }
        this.status = status;
        this.handshakeStatus = handshakeStatus;
        this.bytesConsumed = bytesConsumed;
        this.bytesProduced = bytesProduced;
    
Methods Summary
public final intbytesConsumed()
Returns the number of bytes retrieved from the source buffer(s).

return
the number of bytes retrieved from the source buffer(s).
since
Android 1.0

        return bytesConsumed;
    
public final intbytesProduced()
Returns the number of bytes transferred to the destination buffer(s).

return
the number of bytes transferred to the destination buffer(s).
since
Android 1.0

        return bytesProduced;
    
public final javax.net.ssl.SSLEngineResult$HandshakeStatusgetHandshakeStatus()
Returns the status of the current handshake.

return
the status of the current handshake.
since
Android 1.0

        return handshakeStatus;
    
public final javax.net.ssl.SSLEngineResult$StatusgetStatus()
Returns the return value of the {@code SSLEngine} operation.

return
the return value of the {@code SSLEngine} operation.
since
Android 1.0

        return status;
    
public java.lang.StringtoString()
Returns a string representation of this instance.

return
a string representation of this instance.
since
Android 1.0

        StringBuffer sb = new StringBuffer("SSLEngineReport: Status = ");
        sb.append(status.toString());
        sb.append("  HandshakeStatus = ");
        sb.append(handshakeStatus.toString());
        sb.append("\n                 bytesConsumed = ");
        sb.append(Integer.toString(bytesConsumed));
        sb.append(" bytesProduced = ");
        sb.append(Integer.toString(bytesProduced));
        return sb.toString();