ostore.util
Class OutputBufferImpl

java.lang.Object
  |
  +--ostore.util.OutputBufferImpl
All Implemented Interfaces:
OutputBuffer
Direct Known Subclasses:
ArchiveOutputBuffer, ByteArrayOutputBuffer, CountBuffer, HMACDHHandler.MacBuffer, NetworkOutputBuffer, RandomAccessFileOutputBuffer, SecureHashBuffer, SignedQS.SignatureBuffer, StreamOutputBuffer

public abstract class OutputBufferImpl
extends Object
implements OutputBuffer

A buffer into which QuickSerializable objects can be written. Implements all of the non-essential functions of OutputBuffer, so that other classes only need to implement add (byte) and add (byte, int, int).

The implementations of most of these functions were cribbed from Dennis's SecureHashBuffer class.

Version:
$Id: OutputBufferImpl.java,v 1.12 2002/09/05 08:26:00 hweather Exp $
Author:
Sean C. Rhea
See Also:
QuickSerializable

Constructor Summary
OutputBufferImpl()
           
 
Method Summary
 void add(BigInteger value)
           
 void add(boolean b)
           
abstract  void add(byte input)
          Adds the specified byte to the digest.
 void add(byte[] input)
          Adds the specified byte array to the digest.
abstract  void add(byte[] input, int offset, int length)
          Adds length bytes of the specified array to the digest, starting at offset.
 void add(double x)
           
 void add(InputBuffer in)
          Adds the remaining bytes in the given input buffer to this output buffer.
 void add(int i)
           
 void add(long i)
           
static void add(OutputBuffer buffer, BigInteger value)
           
static void add(OutputBuffer buffer, boolean b)
           
static void add(OutputBuffer buffer, byte[] input)
           
static void add(OutputBuffer buffer, double x)
           
static void add(OutputBuffer out, InputBuffer in)
          Adds the remaining bytes in the given input buffer to this output buffer.
static void add(OutputBuffer buffer, int i)
           
static void add(OutputBuffer buffer, long i)
           
static void add(OutputBuffer buffer, QuickSerializable value)
          Adds the specified object to the digest.
static void add(OutputBuffer buffer, short i)
           
static void add(OutputBuffer buffer, String s)
           
 void add(QuickSerializable value)
          Adds the specified object to the digest.
 void add(short i)
           
 void add(String s)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OutputBufferImpl

public OutputBufferImpl()
Method Detail

add

public abstract void add(byte input)
Adds the specified byte to the digest.

Specified by:
add in interface OutputBuffer

add

public abstract void add(byte[] input,
                         int offset,
                         int length)
Adds length bytes of the specified array to the digest, starting at offset.

Specified by:
add in interface OutputBuffer

add

public void add(byte[] input)
Adds the specified byte array to the digest.

Specified by:
add in interface OutputBuffer

add

public void add(QuickSerializable value)
Adds the specified object to the digest. This method invokes the QuickSerializable.serialize method; be careful to avoid infinite loops.

Specified by:
add in interface OutputBuffer

add

public void add(InputBuffer in)
Adds the remaining bytes in the given input buffer to this output buffer.

Specified by:
add in interface OutputBuffer

add

public void add(boolean b)
Specified by:
add in interface OutputBuffer

add

public void add(short i)
Specified by:
add in interface OutputBuffer

add

public void add(int i)
Specified by:
add in interface OutputBuffer

add

public void add(long i)
Specified by:
add in interface OutputBuffer

add

public void add(double x)
Specified by:
add in interface OutputBuffer

add

public void add(String s)
Specified by:
add in interface OutputBuffer

add

public void add(BigInteger value)
Specified by:
add in interface OutputBuffer

add

public static final void add(OutputBuffer buffer,
                             byte[] input)

add

public static final void add(OutputBuffer buffer,
                             QuickSerializable value)
                      throws AssertionViolatedException
Adds the specified object to the digest. This method invokes the QuickSerializable.serialize method; be careful to avoid infinite loops.

Throws:
AssertionViolatedException - if value is null

add

public static final void add(OutputBuffer out,
                             InputBuffer in)
Adds the remaining bytes in the given input buffer to this output buffer.


add

public static final void add(OutputBuffer buffer,
                             boolean b)

add

public static final void add(OutputBuffer buffer,
                             short i)

add

public static final void add(OutputBuffer buffer,
                             int i)

add

public static final void add(OutputBuffer buffer,
                             long i)

add

public static final void add(OutputBuffer buffer,
                             double x)

add

public static final void add(OutputBuffer buffer,
                             String s)

add

public static final void add(OutputBuffer buffer,
                             BigInteger value)