com.mot.iden.zip
Class CheckedInputStream

java.lang.Object
  extended byjava.io.InputStream
      extended bycom.mot.iden.zip.FilterInputStream
          extended bycom.mot.iden.zip.CheckedInputStream

public class CheckedInputStream
extends FilterInputStream

This API is a Licensee Closed Class and is therefore reserved for use by Motorola and it's Licensees

An input stream that also maintains a checksum of the data being read. The checksum can then be used to verify the integrity of the input data.


MOTOROLA and the Stylized M Logo are registered trademarks of Motorola, Inc. Reg. U.S. Pat. & Tm. Off.
© Copyright 2001-2003 Motorola, Inc. All Rights Reserved.

See Also:
Checksum

Field Summary
 
Fields inherited from class com.mot.iden.zip.FilterInputStream
in
 
Constructor Summary
CheckedInputStream(java.io.InputStream in, Checksum cksum)
          Creates an input stream using the specified Checksum.
 
Method Summary
 Checksum getChecksum()
          Returns the Checksum for this input stream.
 int read()
          Reads a byte.
 int read(byte[] buf, int off, int len)
          Reads into an array of bytes.
 long skip(long n)
          Skips specified number of bytes of input.
 
Methods inherited from class com.mot.iden.zip.FilterInputStream
available, close, mark, markSupported, read, reset
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CheckedInputStream

public CheckedInputStream(java.io.InputStream in,
                          Checksum cksum)
Creates an input stream using the specified Checksum.

Parameters:
in - the input stream
cksum - the Checksum
Method Detail

read

public int read(byte[] buf,
                int off,
                int len)
         throws java.io.IOException
Reads into an array of bytes. Will block until some input is available.

Overrides:
read in class FilterInputStream
Parameters:
buf - the buffer into which the data is read
off - the start offset of the data
len - the maximum number of bytes read
Returns:
the actual number of bytes read, or -1 if the end of the stream is reached.
Throws:
java.io.IOException - if an I/O error has occurred
See Also:
FilterInputStream.in

read

public int read()
         throws java.io.IOException
Reads a byte. Will block if no input is available.

Overrides:
read in class FilterInputStream
Returns:
the byte read, or -1 if the end of the stream is reached.
Throws:
java.io.IOException - if an I/O error has occurred
See Also:
FilterInputStream.in

skip

public long skip(long n)
          throws java.io.IOException
Skips specified number of bytes of input.

Overrides:
skip in class FilterInputStream
Parameters:
n - the number of bytes to skip
Returns:
the actual number of bytes skipped
Throws:
java.io.IOException - if an I/O error has occurred

getChecksum

public Checksum getChecksum()
Returns the Checksum for this input stream.

Returns:
the Checksum value