cryptix.pgp
Class PacketByteArray

java.lang.Object
  |
  +--cryptix.pgp.PacketByteArray

public class PacketByteArray
extends java.lang.Object

A PacketByteArray is a sequence of PGP packets stored as an array of bytes.

This class abstracts this idea, making it possible to specify that a class that requires packets as input won't accept just any old byte array, but only byte arrays that contain packets. It can also do syntax checking, and extract information about the packets therein.


Copyright © 1995-1997 Systemics Ltd on behalf of the Cryptix Development Team.
All rights reserved.

$Revision: 1.1.1.1 $

Since:
Cryptix 2.2 or earlier
Author:
Jill Baker

Field Summary
protected  byte[] data
           
protected  java.util.Vector offsetVector
           
 
Constructor Summary
PacketByteArray(byte[] buffer)
           
PacketByteArray(PacketInputStream in)
           
 
Method Summary
 void add(PacketByteArray suffix)
          Concatenates another PacketByteArray to this one.
 int getPacketLength(int packetNum)
           
 int getPacketOffset(int packetNum)
           
 int getPacketType(int packetNum)
           
 int numPackets()
           
 byte[] toByteArray()
           
 PacketInputStream toPacketInputStream()
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

data

protected byte[] data

offsetVector

protected java.util.Vector offsetVector
Constructor Detail

PacketByteArray

public PacketByteArray(byte[] buffer)
                throws FormatException

PacketByteArray

public PacketByteArray(PacketInputStream in)
                throws FormatException,
                       java.io.IOException
Method Detail

numPackets

public int numPackets()

getPacketOffset

public int getPacketOffset(int packetNum)

getPacketLength

public int getPacketLength(int packetNum)

getPacketType

public int getPacketType(int packetNum)

toByteArray

public byte[] toByteArray()

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

toPacketInputStream

public PacketInputStream toPacketInputStream()

add

public void add(PacketByteArray suffix)
         throws FormatException
Concatenates another PacketByteArray to this one.