org.web3d.vrtp.util
Class ADUStreamByteArray

java.lang.Object
  |
  +--org.web3d.vrtp.util.ADUStream
        |
        +--org.web3d.vrtp.util.ADUStreamByteArray
All Implemented Interfaces:
DatasourceIF

public class ADUStreamByteArray
extends ADUStream

ADUStreamByteArray

This class reads one or more ADUs from a byte array of data. There may be several ADUs of various types saved in the byte array of input data.

Author:
Don McGregor mcgredo@nps.navy.mil

Fields inherited from class org.web3d.vrtp.util.ADUStream
isReading, protocol
 
Constructor Summary
ADUStreamByteArray(byte[] pInputBuffer, ProtocolDescription pProtocol)
           
 
Method Summary
 java.util.Vector getADUs()
          Threaded access.
 boolean hasNext()
          returns true if there are more ADUs available from the input source
static void main(java.lang.String[] args)
           
 ADUData readNext()
          Returns the next ADUData in the input stream
 void resumeReading()
          resume reading again
 void run()
          Runnable interface, for threads
 void stopReading()
          stop thread reading
 void writeADU(ADUData pAdu)
          ADU to be written.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ADUStreamByteArray

public ADUStreamByteArray(byte[] pInputBuffer,
                          ProtocolDescription pProtocol)
Method Detail

hasNext

public boolean hasNext()
returns true if there are more ADUs available from the input source
Overrides:
hasNext in class ADUStream

readNext

public ADUData readNext()
Returns the next ADUData in the input stream
Overrides:
readNext in class ADUStream

writeADU

public void writeADU(ADUData pAdu)
ADU to be written. This actually has no meaning here. Throw an exception if they try it.
Overrides:
writeADU in class ADUStream

getADUs

public java.util.Vector getADUs()
Threaded access. If the object gets kicked off in a thread, these methods can be used to return packets
Overrides:
getADUs in class ADUStream

stopReading

public void stopReading()
stop thread reading
Overrides:
stopReading in class ADUStream

resumeReading

public void resumeReading()
resume reading again
Overrides:
resumeReading in class ADUStream

run

public void run()
Runnable interface, for threads
Overrides:
run in class ADUStream

main

public static void main(java.lang.String[] args)