com.partnersoft.io.formats.packrat
Class PackratBlob

java.lang.Object
  extended by com.partnersoft.io.formats.packrat.PackratDatatype
      extended by com.partnersoft.io.formats.packrat.PackratBlob
All Implemented Interfaces:
PackratConstants, java.io.Serializable

public class PackratBlob
extends PackratDatatype

An blob in the Packrat format.

Author:
Paul Reavis Copyright 2002 Partner Software, Inc.
See Also:
Serialized Form

Field Summary
 
Fields inherited from class com.partnersoft.io.formats.packrat.PackratDatatype
EMPTY_TYPE_ARRAY, sizeParam
 
Fields inherited from interface com.partnersoft.io.formats.packrat.PackratConstants
DATATYPE_ARRAY, DATATYPE_ASSOC, DATATYPE_BLOB, DATATYPE_FLAG_COLLECTION, DATATYPE_FLAG_FIXED, DATATYPE_FLAG_STRUCT, DATATYPE_FLAG_VARIABLE, DATATYPE_FLOAT, DATATYPE_INT, DATATYPE_LIST, DATATYPE_STRING, DATATYPE_STRUCT, DATATYPE_UINT
 
Constructor Summary
PackratBlob()
           
PackratBlob(java.lang.String name)
           
 
Method Summary
 java.lang.Object bytesToObject(ByteBuffer input)
          Convert the given bytes to an appropriate object representation.
 int getFixedSize()
           
 int getTypeCode()
          Return a single-byte code for the type.
 java.lang.String getTypeDescription()
          Return a String description of the data type (e.g.
 boolean isFixedSize()
          If true, datatype requires a fixed number of bytes.
 void objectToBytes(java.lang.Object input, ByteBuffer output)
          Convert the given object to its binary representation.
 
Methods inherited from class com.partnersoft.io.formats.packrat.PackratDatatype
appendAllTypes, getFixedSizeAmount, getFullDescription, getName, getSizeParam, getSubtypes, objectToByteArray, objectToByteBuffer, objectToBytes, readSize, setName, setSizeParam, toString, writeSize, writeSize
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PackratBlob

public PackratBlob()

PackratBlob

public PackratBlob(java.lang.String name)
Method Detail

getTypeCode

public int getTypeCode()
Description copied from class: PackratDatatype
Return a single-byte code for the type. Must be unique. Valid codes are defined in PackratConstants.

Specified by:
getTypeCode in class PackratDatatype

getTypeDescription

public java.lang.String getTypeDescription()
Description copied from class: PackratDatatype
Return a String description of the data type (e.g. "String", "UInt16", etc.)

Specified by:
getTypeDescription in class PackratDatatype

isFixedSize

public boolean isFixedSize()
Description copied from class: PackratDatatype
If true, datatype requires a fixed number of bytes.

Specified by:
isFixedSize in class PackratDatatype

getFixedSize

public int getFixedSize()

objectToBytes

public void objectToBytes(java.lang.Object input,
                          ByteBuffer output)
Description copied from class: PackratDatatype
Convert the given object to its binary representation. Throws IllegalArgumentException if it doesn't like the input.

Specified by:
objectToBytes in class PackratDatatype

bytesToObject

public java.lang.Object bytesToObject(ByteBuffer input)
Description copied from class: PackratDatatype
Convert the given bytes to an appropriate object representation. Throws IllegalArgumentException if it doesn't like the input.

Specified by:
bytesToObject in class PackratDatatype