Android
java.util.zip
public class

java.util.zip.CheckedOutputStream

java.lang.Object
java.io.OutputStream Closeable Flushable
java.io.FilterOutputStream
java.util.zip.CheckedOutputStream

The CheckedOutputStream class is used to maintain a running Checksum of all data written to a stream.

Summary

Fields inherited from class java.io.FilterOutputStream

Public Constructors

            CheckedOutputStream(OutputStream os, Checksum cs)
Constructs a new CheckedOutputStream on OutputStream os.

Public Methods

          Checksum  getChecksum()
Returns the Checksum calculated on the stream thus far.
          void  write(int val)
Writes byte value val to the underlying stream.
          void  write(byte[] buf, int off, int nbytes)
Writes nbytes of data from buf starting at offset off to the underlying stream.
Methods inherited from class java.io.FilterOutputStream
Methods inherited from class java.io.OutputStream
Methods inherited from class java.lang.Object
Methods inherited from interface java.io.Closeable
Methods inherited from interface java.io.Flushable

Details

Public Constructors

public CheckedOutputStream(OutputStream os, Checksum cs)

Constructs a new CheckedOutputStream on OutputStream os. The Checksum will be calculated using the algorithm implemented by csum.

Parameters

os OutputStream to calculate checksum from
cs Type of Checksum to calculate

Public Methods

public Checksum getChecksum()

Returns the Checksum calculated on the stream thus far.

Returns

  • A java.util.zip.Checksum

public void write(int val)

Writes byte value val to the underlying stream. The Checksum is updated with val.

Parameters

val Value of the byte to write out

Throws

IOException if an IO error has occured

public void write(byte[] buf, int off, int nbytes)

Writes nbytes of data from buf starting at offset off to the underlying stream. The Checksum is updated with the bytes written.

Parameters

buf data to write out
off the start offset of the data
nbytes number of bytes to write out

Throws

IOException if an IO error has occured
Copyright 2007 Google Inc. Build 0.9_r1-98467 - 14 Aug 2008 18:48