For the latest news and information visit
The GNU Crypto project

gnu.crypto.sasl
Class OutputBuffer

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

public class OutputBuffer
extends java.lang.Object

The implementation of an outgoing SASL buffer.

Version:
$Revision: 1.2 $

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
 

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.

Parameters:
count - number of octets to encode b with.
b - the scalar quantity.
Throws:
SaslEncodingException - if an encoding size constraint is violated.
java.io.IOException - if any other I/O exception occurs during the operation.

setOS

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

Encodes a SASL OS to the current buffer.

Parameters:
b - the OS element.
Throws:
SaslEncodingException - if an encoding size constraint is violated.
java.io.IOException - if any other I/O exception occurs during the operation.

setEOS

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

Encodes a SASL EOS to the current buffer.

Parameters:
b - the EOS element.
Throws:
SaslEncodingException - if an encoding size constraint is violated.
java.io.IOException - if any other I/O exception occurs during the operation.

setMPI

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

Encodes a SASL MPI to the current buffer.

Parameters:
val - the MPI element.
Throws:
SaslEncodingException - if an encoding size constraint is violated.
java.io.IOException - if any other I/O exception occurs during the operation.

setText

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

Encodes a SASL Text to the current buffer.

Parameters:
str - the Text element.
Throws:
SaslEncodingException - if an encoding size constraint is violated.
SaslEncodingException - if the UTF-8 encoding is not supported on this platform.
java.io.IOException - if any other I/O exception occurs during the operation.

encode

public byte[] encode()
              throws SaslEncodingException

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

Throws:
SaslEncodingException - if an encoding size constraint is violated.

wrap

public byte[] wrap()
            throws SaslEncodingException

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

Throws:
SaslEncodingException - if an encoding size constraint is violated.

For the latest news and information visit
The GNU Crypto project

Copyright © 2001, 2002, 2003 Free Software Foundation, Inc. All Rights Reserved.