Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

gnu.javax.crypto.sasl
Class OutputBuffer  view OutputBuffer download OutputBuffer.java

java.lang.Object
  extended bygnu.javax.crypto.sasl.OutputBuffer

public class OutputBuffer
extends java.lang.Object

The implementation of an outgoing SASL buffer.

The data elements this class caters for are described in [1].

References:

  1. Secure Remote Password Authentication Mechanism;
    draft-burdis-cat-srp-sasl-09,
    Keith Burdis and Raïf S. Naffah.


Field Summary
private  java.io.ByteArrayOutputStream out
          The internal output stream.
 
Constructor Summary
OutputBuffer()
           
 
Method Summary
 byte[] encode()
          Returns the encoded form of the current buffer including the 4-byte length header.
 void setEOS(byte[] b)
          Encodes a SASL EOS to the current buffer.
 void setMPI(java.math.BigInteger val)
          Encodes a SASL MPI to the current buffer.
 void setOS(byte[] b)
          Encodes a SASL OS to the current buffer.
 void setScalar(int count, int b)
          Encodes a SASL scalar quantity, count-octet long, to the current buffer.
 void setText(java.lang.String str)
          Encodes a SASL Text to the current buffer.
 byte[] wrap()
          Returns the encoded form of the current buffer excluding the 4-byte length header.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

out

private java.io.ByteArrayOutputStream out
The internal output stream.

Constructor Detail

OutputBuffer

public OutputBuffer()
Method Detail

setScalar

public void setScalar(int count,
                      int b)
               throws java.io.IOException

Encodes a SASL scalar quantity, count-octet long, to the current buffer.


setOS

public void setOS(byte[] b)
           throws java.io.IOException

Encodes a SASL OS to the current buffer.


setEOS

public void setEOS(byte[] b)
            throws java.io.IOException

Encodes a SASL EOS to the current buffer.


setMPI

public void setMPI(java.math.BigInteger val)
            throws java.io.IOException

Encodes a SASL MPI to the current buffer.


setText

public void setText(java.lang.String str)
             throws java.io.IOException

Encodes a SASL Text to the current buffer.


encode

public byte[] encode()
              throws SaslEncodingException

Returns the encoded form of the current buffer including the 4-byte length header.


wrap

public byte[] wrap()
            throws SaslEncodingException

Returns the encoded form of the current buffer excluding the 4-byte length header.