Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

cryptix.openpgp.io
Class PGPDataOutputStream  view PGPDataOutputStream download PGPDataOutputStream.java

java.lang.Object
  extended bycryptix.openpgp.io.PGPDataOutputStream
Direct Known Subclasses:
PGPByteArrayDataOutputStream, PGPChecksumDataOutputStream, PGPLengthDataOutputStream, PGPWrapperDataOutputStream

public abstract class PGPDataOutputStream
extends java.lang.Object

Generic superclass for all outputstreams

This class contains the basic methods for outputstreams. A subclass only has to implement the writeInternal and close methods and then all the other methods here will magically work.

Version:
$Revision: 1.2 $

Constructor Summary
PGPDataOutputStream()
          Empty constructor
 
Method Summary
abstract  void close()
          Close this inputstream
 void writeBoolean(boolean x)
          Write a boolean
 void writeByte(byte x)
          Write a byte
 void writeFully(byte[] b)
          Write an array of bytes
 void writeFully(byte[] b, int offset, int len)
          Write an array of bytes
 void writeInt(int x)
          Write an int
protected abstract  void writeInternal(int b)
          Internal method used by all other methods to write one byte.
 void writeLengthPrependedString(java.lang.String x)
          Write a string with a length byte prepended
 void writeLong(long x)
          Write a long
 void writeMPI(java.math.BigInteger x)
          Write a PGP encoded multi-precision-integer (MPI)
 void writeNullTerminatedString(java.lang.String x)
          Write a null terminated string
 void writeShort(short x)
          Write a short
 void writeString(java.lang.String x)
          Write a string
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PGPDataOutputStream

public PGPDataOutputStream()
Empty constructor

Method Detail

writeInternal

protected abstract void writeInternal(int b)
                               throws java.io.IOException
Internal method used by all other methods to write one byte.


close

public abstract void close()
                    throws java.io.IOException
Close this inputstream


writeBoolean

public void writeBoolean(boolean x)
                  throws java.io.IOException
Write a boolean


writeByte

public void writeByte(byte x)
               throws java.io.IOException
Write a byte


writeShort

public void writeShort(short x)
                throws java.io.IOException
Write a short


writeInt

public void writeInt(int x)
              throws java.io.IOException
Write an int


writeLong

public void writeLong(long x)
               throws java.io.IOException
Write a long


writeFully

public void writeFully(byte[] b)
                throws java.io.IOException
Write an array of bytes

The complete array is written, calling this method is equivalent to writeFully(b, 0, b.length);


writeFully

public void writeFully(byte[] b,
                       int offset,
                       int len)
                throws java.io.IOException
Write an array of bytes

Writing starts at offset and continues for len bytes.


writeString

public void writeString(java.lang.String x)
                 throws java.io.IOException
Write a string

This method writes a string in UTF-8 encoding.


writeNullTerminatedString

public void writeNullTerminatedString(java.lang.String x)
                               throws java.io.IOException
Write a null terminated string

This method simply calls writeString and then writes a null byte.


writeLengthPrependedString

public void writeLengthPrependedString(java.lang.String x)
                                throws java.io.IOException
Write a string with a length byte prepended


writeMPI

public void writeMPI(java.math.BigInteger x)
              throws java.io.IOException
Write a PGP encoded multi-precision-integer (MPI)

This method uses the cryptix.openpgp.util.PGPMPI class to write an MPI.