java util zip CheckedInputStream








Class java.util.zip.CheckedInputStream





All Packages Class Hierarchy This Package Previous Next Index


Class java.util.zip.CheckedInputStream


java.lang.Object
|
+----java.io.InputStream
|
+----java.io.FilterInputStream
|
+----java.util.zip.CheckedInputStream



public class CheckedInputStream
extends FilterInputStream

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.


See Also:
Checksum








CheckedInputStream(InputStream, Checksum)
Creates an input stream using the specified Checksum.






getChecksum()
Returns the Checksum for this input stream.

read()
Reads a byte.

read(byte[], int, int)
Reads into an array of bytes.

skip(long)
Skips specified number of bytes of input.







CheckedInputStream

public CheckedInputStream(InputStream in,
Checksum cksum)


Creates an input stream using the specified Checksum.


Parameters:
in - the input stream
cksum - the Checksum







read

public int read() throws IOException


Reads a byte. Will block if no input is available.


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



read

public int read(byte buf[],
int off,
int len) throws IOException


Reads into an array of bytes. Will block until some input
is available.


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: IOException
if an I/O error has occurred
Overrides:
read in class FilterInputStream



skip

public long skip(long n) throws IOException


Skips specified number of bytes of input.


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



getChecksum

public Checksum getChecksum()


Returns the Checksum for this input stream.




All Packages Class Hierarchy This Package Previous Next Index

Submit a bug or feature - Version 1.1.7 of Java Platform API Specification
Java is a trademark or registered trademark of Sun Microsystems, Inc. in the US and other countries.
Copyright 1995-1998 Sun Microsystems, Inc. 901 San Antonio Road,
Palo Alto, California, 94303, U.S.A. All Rights Reserved.




Wyszukiwarka

Podobne podstrony:
java util zip CheckedOutputStream
Package java util zip
java util zip Adler32
java util zip ZipInputStream
java util zip DeflaterOutputStream
java util zip InflaterInputStream
java util zip GZIPOutputStream
java util zip ZipFile
java util zip Deflater
java util zip Inflater
java util zip ZipException
java util zip GZIPInputStream
java util zip CRC32
java util zip DataFormatException
java util zip Checksum
java util zip ZipEntry
java util zip ZipOutputStream
java util MissingResourceException
java util Properties

więcej podobnych podstron