com.resilientedge.jockey.appcomm
Class AbstractMarshallable

java.lang.Object
  |
  +--com.resilientedge.jockey.appcomm.AbstractMarshallable
All Implemented Interfaces:
Marshallable
Direct Known Subclasses:
Request, Response

public abstract class AbstractMarshallable
extends java.lang.Object
implements Marshallable

An implementation of marshallable to do basic marshalling.

Version:
$Revision: 1.1.1.1 $
Author:
John Gardner

Fields inherited from interface com.resilientedge.jockey.appcomm.Marshallable
FAILED, SUCCESS, TYPE_FIXED_STRING, TYPE_OBJECT, TYPE_UINT_32
 
Constructor Summary
AbstractMarshallable()
           
 
Method Summary
 int fromBytes(byte[] buffer, int offset)
          Reinitialize this object from the contents of an array of bytes.
 int getMarshalSize()
          Return the number of bytes that this object would require to marshal itself.
 int getRealMarshalSize()
          Return the number of bytes that this object would require to marshal itself.
 int toBytes(byte[] buffer, int offset)
          Marshal this object to a language independent array of bytes.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.resilientedge.jockey.appcomm.Marshallable
getMarshalName
 

Constructor Detail

AbstractMarshallable

public AbstractMarshallable()
Method Detail

toBytes

public int toBytes(byte[] buffer,
                   int offset)
Marshal this object to a language independent array of bytes. Should be called by any subclass before marshalling derived attributes.
Specified by:
toBytes in interface Marshallable
Parameters:
buffer - a destination buffer to receive this object.
offset - begin marshalling at this offset from buffer start
Returns:
the number of bytes of the input buffer consumed.

fromBytes

public int fromBytes(byte[] buffer,
                     int offset)
Reinitialize this object from the contents of an array of bytes. Should be called by any subclass before unmarshalling derived attributes.
Specified by:
fromBytes in interface Marshallable
Parameters:
buffer - a buffer containing the marshalled object.
offset - begin unmarshalling at this offset from buffer start
Returns:
the number of bytes of the input buffer consumed.

getMarshalSize

public int getMarshalSize()
Return the number of bytes that this object would require to marshal itself. Should be called by any subclass and added to defived size.
Specified by:
getMarshalSize in interface Marshallable
Returns:
the number of bytes that the header information requires.

getRealMarshalSize

public int getRealMarshalSize()
Return the number of bytes that this object would require to marshal itself. Should be called by any subclass and added to defived size.
Returns:
the number of bytes that the header information requires.


Copyright © 2001 Resilient Edge, Inc. All Rights Reserved.