SHOW Signed
 

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.

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:
JDE 3.6.0
See Also:
OutputStream, InputStream

Field Summary
 Category: Signed protected  OutputStream _out
          The underlying output stream to be filtered.
 
Constructor Summary
 Category: Signed CryptoOutputStream(OutputStream out)
          Creates a CryptoOutputStream object, an output stream filter built on top of the specified output stream.
 
Method Summary
 Category: Signed  void close()
          Closes the output stream.
 Category: Signed  void flush()
          Flushes out the remainder of the data in the output stream.
 Category: Signed abstract  String getAlgorithm()
          Returns the name of this algorithm, eg "DES".
 Category: Signed  OutputStream getOutputStream()
          Returns the output stream associated with this class.
 Category: Signed  void write(byte[] buffer)
          Writes a byte array to this output stream.
 Category: Signed abstract  void write(byte[] buffer, int offset, int length)
          Writes a specified length of bytes from the given byte array to this output stream.
 Category: Signed  void write(int datum)
          Writes the specified byte to this output stream.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_out

protected OutputStream _out
The underlying output stream to be filtered.
Since:
JDE 3.6.0
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.
Constructor Detail

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.
Since:
JDE 3.6.0
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.
Method Detail

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.
Since:
JDE 3.6.0
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.

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.
Since:
JDE 3.6.0
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.

getAlgorithm

public abstract String getAlgorithm()
Returns the name of this algorithm, eg "DES".

Returns:
A String that represents the name of the algorithm.
Since:
JDE 3.6.0
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.

getOutputStream

public OutputStream getOutputStream()
Returns the output stream associated with this class.

Returns:
The OutputStream object.
Since:
JDE 3.6.0
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.

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.
Since:
JDE 3.6.0
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.

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.
Since:
JDE 3.6.0
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.

write

public void write(int datum)
           throws IOException
Writes the specified byte to this output stream.

Overrides:
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.
Since:
JDE 3.6.0
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.



Copyright 1999-2009 Research In Motion Limited. 295 Phillip Street, Waterloo, Ontario, Canada, N2L 3W8. All Rights Reserved.
Copyright 1993-2003 Sun Microsystems, Inc. 901 San Antonio Road, Palo Alto, California, 94303, U.S.A.
Copyright 2002-2003 Nokia Corporation All Rights Reserved.
Java is a trademark or registered trademark of Sun Microsystems, Inc. in the US and other countries.