Build 1.0_r1(from source)

javax.crypto
Class CipherInputStream

java.lang.Object
  extended by java.io.InputStream
      extended by java.io.FilterInputStream
          extended by javax.crypto.CipherInputStream
All Implemented Interfaces:
Closeable

public class CipherInputStream
extends FilterInputStream


Field Summary
 
Fields inherited from class java.io.FilterInputStream
in
 
Constructor Summary
protected CipherInputStream(InputStream is)
           
  CipherInputStream(InputStream is, Cipher c)
           
 
Method Summary
 int available()
          Returns a int representing the number of bytes that are available before this FilterInputStream will block.
 void close()
          Close this FilterInputStream.
 boolean markSupported()
          Returns a boolean indicating whether or not this FilterInputStream supports mark() and reset().
 int read()
          Reads a single byte from this FilterInputStream and returns the result as an int.
 int read(byte[] b)
          Reads bytes from this FilterInputStream and stores them in byte array buffer.
 int read(byte[] b, int off, int len)
          Reads at most count bytes from this FilterInputStream and stores them in byte array buffer starting at offset.
 long skip(long n)
          Skips count number of bytes in this InputStream.
 
Methods inherited from class java.io.FilterInputStream
mark, reset
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CipherInputStream

public CipherInputStream(InputStream is,
                         Cipher c)

CipherInputStream

protected CipherInputStream(InputStream is)
Method Detail

read

public int read()
         throws IOException
Description copied from class: FilterInputStream
Reads a single byte from this FilterInputStream and returns the result as an int. The low-order byte is returned or -1 of the end of stream was encountered. This implementation returns a byte from the target stream.

Overrides:
read in class FilterInputStream
Returns:
the byte read or -1 if end of stream.
Throws:
IOException - If the stream is already closed or another IOException occurs.

read

public int read(byte[] b)
         throws IOException
Description copied from class: FilterInputStream
Reads bytes from this FilterInputStream and stores them in byte array buffer. Answer the number of bytes actually read or -1 if no bytes were read and end of stream was encountered. This implementation reads bytes from the target stream.

Overrides:
read in class FilterInputStream
Parameters:
b - the byte array in which to store the read bytes.
Returns:
the number of bytes actually read or -1 if end of stream.
Throws:
IOException - If the stream is already closed or another IOException occurs.

read

public int read(byte[] b,
                int off,
                int len)
         throws IOException
Description copied from class: FilterInputStream
Reads at most count bytes from this FilterInputStream and stores them in byte array buffer starting at offset. Answer the number of bytes actually read or -1 if no bytes were read and end of stream was encountered. This implementation reads bytes from the target stream.

Overrides:
read in class FilterInputStream
Parameters:
b - the byte array in which to store the read bytes.
off - the offset in buffer to store the read bytes.
len - the maximum number of bytes to store in buffer.
Returns:
the number of bytes actually read or -1 if end of stream.
Throws:
IOException - If the stream is already closed or another IOException occurs.

skip

public long skip(long n)
          throws IOException
Description copied from class: FilterInputStream
Skips count number of bytes in this InputStream. Subsequent read()'s will not return these bytes unless reset() is used. This implementation skips count number of bytes in the target stream.

Overrides:
skip in class FilterInputStream
Parameters:
n - the number of bytes to skip.
Returns:
the number of bytes actually skipped.
Throws:
IOException - If the stream is already closed or another IOException occurs.

available

public int available()
              throws IOException
Description copied from class: FilterInputStream
Returns a int representing the number of bytes that are available before this FilterInputStream will block. This method returns the number of bytes available in the target stream.

Overrides:
available in class FilterInputStream
Returns:
the number of bytes available before blocking.
Throws:
IOException - If an error occurs in this stream.

close

public void close()
           throws IOException
Description copied from class: FilterInputStream
Close this FilterInputStream. This implementation closes the target stream.

Specified by:
close in interface Closeable
Overrides:
close in class FilterInputStream
Throws:
IOException - If an error occurs attempting to close this stream.

markSupported

public boolean markSupported()
Description copied from class: FilterInputStream
Returns a boolean indicating whether or not this FilterInputStream supports mark() and reset(). This implementation returns whether or not the target stream supports marking.

Overrides:
markSupported in class FilterInputStream
Returns:
true if mark() and reset() are supported, false otherwise.

Build 1.0_r1(from source)

Please submit a feedback, bug or feature