org.jSyncManager.API.Protocol.Util
Class DLPBlock
java.lang.Objectorg.jSyncManager.API.Protocol.Util.DLPBlock
- Serializable
public class DLPBlock
extends java.lang.Object
implements Serializable
A class that represents database information blocks.
This class stores a data block. This is typically used in
Palm databases to store the application block and the sort block.
protected int | blockSize- Holds the size of the block.
|
protected byte[] | data- Holds the data array representing this block.
|
DLPBlock()- Creates an empty block, with size 0.
|
DLPBlock(inputData[] )- Creates a new block based on the input byte array.
|
DLPBlock(inputData[] , char blockSize)- Creates a new block based on the input byte array.
|
protected void | generateData()- Generates the data block from a set of class fields.
|
int | getBlockSize()- Returns the size of this block.
|
byte[] | getData()- Retreives the byte array containing the data in this block.
|
protected void | parseFields()- Parses the data block into a set of fields.
|
void | setData(data[] )- Sets the data byte array for this block.
|
String | toString()- Returns a human-readable hex representation of the block data.
|
blockSize
protected int blockSize
Holds the size of the block.
data
protected byte[] data
Holds the data array representing this block.
DLPBlock
public DLPBlock()
Creates an empty block, with size 0.
DLPBlock
public DLPBlock(inputData[] )
throws DLPFunctionCallExceptionCreates a new block based on the input byte array.
This construct is typically used when the block is read from the handheld via the DLP protocol,
as it includes two extra bytes of sizing data that don't exist in PDB files.
DLPBlock
public DLPBlock(inputData[] ,
char blockSize)
throws DLPFunctionCallExceptionCreates a new block based on the input byte array.
This constructor is best suited for uses where the input data does not contain the two-byte
blocksize preceeding the data in the input byte array.
blockSize - the size of the input block.
generateData
protected void generateData()
Generates the data block from a set of class fields.
This method is called to take the input fields in the block class, and
to form a byte array representation of the block.
This method is intended for implementation by subclasses. In this class,
its implementation is null.
getBlockSize
public int getBlockSize()
Returns the size of this block.
This is the size of the block as reported by the Palm at generation time. To get the
actual number of bytes in the current data array, you should instead use getData().length.
getData
public byte[] getData()
Retreives the byte array containing the data in this block.
- the byte array containing the data in this block.
parseFields
protected void parseFields()
throws ParseExceptionParses the data block into a set of fields.
This method is called to take the input byte array in the block class, and
to parse it into its representitive fields.
This method is intended for implementation by subclasses. In this class,
its implementation is null.
ParseException - if an error is encountered while parsing the data fields.
setData
public void setData(data[] )
throws ParseExceptionSets the data byte array for this block.
toString
public String toString()
Returns a human-readable hex representation of the block data.