net.rim.device.api.crypto
Class CryptoOutputStream
java.lang.Object
java.io.OutputStream
net.rim.device.api.crypto.CryptoOutputStream
- Direct Known Subclasses:
- DigestOutputStream, EncryptorOutputStream, MACOutputStream, SignatureSignerOutputStream
public abstract class CryptoOutputStream
- extends OutputStream
The superclass of all classes that filter output streams.
These streams sit on top of an already existing output stream (the underlying
output stream) which it uses as its basic sink of data, but possibly
transforming the data along the way or providing additional functionality.
The class CryptoOutputStream itself simply overrides all methods of OutputStream
with versions that pass all requests to the underlying output stream. Subclasses
of CryptoOutputStream may further override some of these methods as well as provide
additional methods and fields.
- See Also:
OutputStream
,
InputStream
- 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
Field Summary |
|
protected OutputStream |
_out
The underlying output stream to be filtered. |
Constructor Summary |
|
CryptoOutputStream(OutputStream out)
Creates a CryptoOutputStream object, an output stream filter built on top of the specified output stream. |
Method Summary |
|
void |
close()
Closes the output stream. |
|
void |
flush()
Flushes out the remainder of the data in the output stream. |
|
abstract String |
getAlgorithm()
Returns the name of this algorithm, eg "DES". |
|
OutputStream |
getOutputStream()
Returns the output stream associated with this class. |
|
void |
write(byte[] buffer)
Writes a byte array to this output stream. |
|
abstract void |
write(byte[] buffer,
int offset,
int length)
Writes a specified length of bytes from the given byte array to
this output stream. |
|
void |
write(int datum)
Writes the specified byte to this output stream. |
_out
protected OutputStream _out
- The underlying output stream to be filtered.
- 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
CryptoOutputStream
public CryptoOutputStream(OutputStream out)
- Creates a
CryptoOutputStream
object, an output stream filter built on top of the specified output stream.
- Parameters:
out
- The output stream to be assigned to this CryptoOutputStream
.- 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 that represents 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
getOutputStream
public OutputStream getOutputStream()
- Returns the output stream associated with this class.
- Returns:
- The
OutputStream
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
write
public void write(int datum)
throws IOException
- Writes the specified byte to this output stream.
- Specified by:
write
in class OutputStream
- Parameters:
datum
- an integer containing the byte that will be
written to the output stream. This is not
a call that writes an entire integer but
rather it writes one byte of that integer
to the outputstream.
- 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
write
public void write(byte[] buffer)
throws IOException
- Writes a byte array to this output stream.
Note that this method does not call the one-argument write method
of its underlying stream with the single argument buffer.
- Overrides:
write
in class OutputStream
- Parameters:
buffer
- A byte array containing the bytes that are
going to be written to the output stream.
- Throws:
IOException
- Thrown if an I/O error occurs.- See Also:
OutputStream.write(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
write
public abstract void write(byte[] buffer,
int offset,
int length)
throws IOException
- Writes a specified length of bytes from the given byte array to
this output stream.
- Overrides:
write
in class OutputStream
- Parameters:
buffer
- The byte array containing the bytes that are
going to be written to the output stream.offset
- The offset in the byte array where the method
will start writing from.length
- The number of bytes that will be written to
the output stream.
- 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
flush
public void flush()
throws IOException
- Flushes out the remainder of the data in the output stream.
- Overrides:
flush
in class OutputStream
- 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 the output stream.
Before closing the stream,
it flushes out all of the data that is in the output stream.
See the flush() method for more information.
- Overrides:
close
in class OutputStream
- 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
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