Compoze Software, Inc.

com.compoze.util
Class XorChecksumOutputStream

java.lang.Object
  extended byjava.io.OutputStream
      extended bycom.compoze.util.XorChecksumOutputStream
All Implemented Interfaces:
java.io.Serializable

public class XorChecksumOutputStream
extends java.io.OutputStream
implements java.io.Serializable

This class is an output stream that performs a simple xor checksum of all of the data that's being written.

See Also:
Serialized Form

Constructor Summary
XorChecksumOutputStream()
          Constructor.
 
Method Summary
 long getChecksum()
          Get the current value of the checksum.
static void main(java.lang.String[] args)
          Exerciser.
 void write(byte[] bytes)
          Write an array of bytes.
 void write(byte[] bytes, int iOffset, int iLength)
          Write an array of bytes.
 void write(int b)
          Write a single byte.
 
Methods inherited from class java.io.OutputStream
close, flush
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XorChecksumOutputStream

public XorChecksumOutputStream()
Constructor.

Method Detail

write

public void write(int b)
Write a single byte.

Parameters:
b - the byte to write

write

public void write(byte[] bytes)
Write an array of bytes.

Parameters:
bytes - the array to write

write

public void write(byte[] bytes,
                  int iOffset,
                  int iLength)
Write an array of bytes.

Parameters:
bytes - the array to write

getChecksum

public long getChecksum()
Get the current value of the checksum.

Returns:
the checksum

main

public static void main(java.lang.String[] args)
Exerciser.


Compoze Software, Inc.

Copyright ©1999-2003 Compoze Software, Inc. All rights reserved.