net.rim.device.api.crypto
Class CryptoInputStream
java.lang.Object
java.io.InputStream
net.rim.device.api.crypto.CryptoInputStream
- Direct Known Subclasses:
- DecryptorInputStream, DigestInputStream, MACInputStream, SignatureVerifierInputStream
public abstract class CryptoInputStream
- extends InputStream
A CryptoInputStream
contains some other input stream, which it
uses as its basic source of data, transforming the data along
the way or providing additional functionality.
The class CryptoInputStream itself simply overrides all methods of
InputStream with versions that pass all requests to the contained
input stream. Subclasses of CryptoInputStream may further override
some of these methods and may also provide additional methods and fields.
- Category:
- Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
- Since:
- BlackBerry API 3.6.0
Constructor Summary |
|
protected |
CryptoInputStream(InputStream in)
Creates a CryptoInputStream object, input stream filter built on top of the specified input stream. |
Method Summary |
|
int |
available()
Returns the number of bytes that can be read from this input
stream without blocking. |
|
void |
close()
Closes this input stream and releases any system resources associated with the stream. |
|
abstract String |
getAlgorithm()
Returns the name of this algorithm, eg "DES". |
|
InputStream |
getInputStream()
Returns the input stream associated with this class. |
|
boolean |
markSupported()
Returns a boolean indicating whether mark() is supported. |
|
int |
read()
Reads the next byte of data from this input stream. |
|
int |
read(byte[] buffer)
Reads as many bytes of data from this input stream as are
necessary to fill the given byte array. |
|
abstract int |
read(byte[] buffer,
int offset,
int length)
Reads up to the specified number of bytes from this input stream
into an array of bytes. |
_inputStream
protected InputStream _inputStream
- The input stream to be operated on.
- Category:
- Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
- Since:
- BlackBerry API 3.6.0
CryptoInputStream
protected CryptoInputStream(InputStream in)
- Creates a
CryptoInputStream
object, input stream filter built on top of the specified input stream.
- Parameters:
in
- The underlying input stream to be assigned to this CryptoInputStream
.- Category:
- Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
- Since:
- BlackBerry API 3.6.0
getAlgorithm
public abstract String getAlgorithm()
- Returns the name of this algorithm, eg "DES".
- Returns:
- A String representing the name of the algorithm.
- Category:
- Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
- Since:
- BlackBerry API 3.6.0
read
public int read()
throws IOException
- Reads the next byte of data from this input stream.
The value byte is returned as an int in the range 0 to 255.
If no byte is available because the end of the stream has
been reached, the value -1 is returned. This method blocks
until input data is available, the end of the stream is
detected, or an exception is thrown.
- Specified by:
read
in class InputStream
- Returns:
- The next byte of data, or -1 if the end of the stream is reached.
- Throws:
IOException
- Thrown if an I/O error occurs.- Category:
- Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
- Since:
- BlackBerry API 3.6.0
read
public int read(byte[] buffer)
throws IOException
- Reads as many bytes of data from this input stream as are
necessary to fill the given byte array.
This method blocks
until some input is available.
- Overrides:
read
in class InputStream
- Parameters:
buffer
- The buffer into which the data is read.
- Returns:
- The total number of bytes read into the buffer,
or -1 if there is no more data because the end
of the stream has been reached.
- Throws:
IOException
- Thrown if an I/O error occurs.- See Also:
InputStream.read(byte[], int, int)
- Category:
- Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
- Since:
- BlackBerry API 3.6.0
read
public abstract int read(byte[] buffer,
int offset,
int length)
throws IOException
- Reads up to the specified number of bytes from this input stream
into an array of bytes. This method blocks until some
input is available.
- Overrides:
read
in class InputStream
- Parameters:
buffer
- The buffer into which the data is read.offset
- The starting offset within the buffer, to store the data.length
- The maximum number of bytes to read.
- Returns:
- The total number of bytes read into the buffer,
or -1 if there is no more data because the end
of the stream has been reached.
- Throws:
IOException
- Thrown if an I/O error occurs.- See Also:
InputStream.read()
- Category:
- Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
- Since:
- BlackBerry API 3.6.0
available
public int available()
throws IOException
- Returns the number of bytes that can be read from this input
stream without blocking.
- Overrides:
available
in class InputStream
- Returns:
- An integer representing the number of bytes.
- Throws:
IOException
- Thrown if an I/O error occurs.- Category:
- Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
- Since:
- BlackBerry API 3.6.0
close
public void close()
throws IOException
- Closes this input stream and releases any system resources associated with the stream.
- Overrides:
close
in class InputStream
- Throws:
IOException
- Thrown if an I/O error occurs.- Category:
- Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
- Since:
- BlackBerry API 3.6.0
markSupported
public boolean markSupported()
- Returns a boolean indicating whether
mark()
is supported.
The mark()
method is not presently supported, so this always returns false.
- Overrides:
markSupported
in class InputStream
- Returns:
true
if this true type supports the mark and reset
method; false
otherwise.- See Also:
InputStream.mark(int)
,
InputStream.reset()
- Category:
- Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
- Since:
- BlackBerry API 3.6.0
getInputStream
public InputStream getInputStream()
- Returns the input stream associated with this class.
- Returns:
- The
inputStream
object. - Category:
- Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
- Since:
- BlackBerry API 3.6.0
Copyright 1999-2011 Research In Motion Limited. 295 Phillip Street, Waterloo, Ontario, Canada, N2L 3W8. All Rights Reserved.
Java is a trademark of Oracle America Inc. in the US and other countries.
Legal