its.backbone.frame
Class ItsData

java.lang.Object
  extended byits.backbone.frame.ItsData

public abstract class ItsData
extends java.lang.Object

ItsData describes the operations that ITS data types should implement. In addition to implementing the abstract methods, your subclass should be constructable from both an ItsInputStream and from a byte array.

Version:
$Id: ItsData.java,v 1.7 1998/02/13 21:39:46 kint Exp $
Author:
Rick Kint

Constructor Summary
ItsData()
           
 
Method Summary
abstract  int getNetworkSize()
          Return the length in bytes of this object when it is put into network format.
 void read(byte[] bytes)
          Read the instance from a byte array.
abstract  void read(ItsInputStream in)
          Reads the instance from an ItsInputStream.
 byte[] toByteArray()
          Produce a byte array representation of the instance.
abstract  void write(ItsOutputStream out)
          Write the instance to an ItsOutputStream.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ItsData

public ItsData()
Method Detail

read

public abstract void read(ItsInputStream in)
                   throws java.io.IOException,
                          ItsException
Reads the instance from an ItsInputStream.

Parameters:
in - the ItsInputStream from which to read.
Throws:
java.io.IOException - io error
ItsException - its exception

read

public void read(byte[] bytes)
          throws java.io.IOException,
                 ItsException
Read the instance from a byte array. This is not abtract, it is just a wrapper around the read(ItsInputStream) method.

Parameters:
bytes - the byte array from which to read.
Throws:
java.io.IOException - io error
ItsException - its exception

write

public abstract void write(ItsOutputStream out)
                    throws java.io.IOException
Write the instance to an ItsOutputStream.

Parameters:
out - the ItsOutputStream to which to write
Throws:
java.io.IOException

toByteArray

public byte[] toByteArray()
Produce a byte array representation of the instance. This will usually take the form


getNetworkSize

public abstract int getNetworkSize()
Return the length in bytes of this object when it is put into network format. For atomic structures this will be a constant, for composites this should call getNetworkSize() for all components