rcxport
Class RCXPacket

java.lang.Object
  |
  +--rcxport.RCXPacket

class RCXPacket
extends Object
implements Serializable

Packet for communication with RCX. This class encodes a byte array provided upon construction as an RCX packet according to the RCX Internals web page.

Author:
Scott B. Lewis, slewis@teleport.com
See Also:
Serialized Form

Field Summary
protected  byte[] myData
           
protected  byte[] mySendData
           
static byte PACKETHEADER1
           
static byte PACKETHEADER2
           
static byte PACKETHEADER3
           
 
Constructor Summary
protected RCXPacket(byte[] data)
          Constructor.
 
Method Summary
 String toString()
           
protected  void writePacket(OutputStream os)
          Writes this packet to the given output stream.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

PACKETHEADER1

public static final byte PACKETHEADER1

PACKETHEADER2

public static final byte PACKETHEADER2

PACKETHEADER3

public static final byte PACKETHEADER3

myData

protected byte[] myData

mySendData

protected byte[] mySendData
Constructor Detail

RCXPacket

protected RCXPacket(byte[] data)
Constructor. Data provided should be a byte array of length >= 1.
Method Detail

writePacket

protected void writePacket(OutputStream os)
                    throws IOException
Writes this packet to the given output stream.
Parameters:
os - the OutputStream to write to
Throws:
IOException - thrown if there is no data to write, or the write fails for some reason

toString

public String toString()
Overrides:
toString in class Object