brf.j2me.dynaworks.db
Class BytesField

java.lang.Object
  |
  +--brf.j2me.dynaworks.db.RecordField
        |
        +--brf.j2me.dynaworks.db.BytesField

public class BytesField
extends RecordField

Field record holding a byte array.

Version:
1.0a1
Author:
Bernd R. Fix
See Also:
RecordField

Field Summary
private  byte[] content
          byte array as field data.
 
Fields inherited from class brf.j2me.dynaworks.db.RecordField
size
 
Constructor Summary
BytesField(int s)
          Construct a record field containing a byte array.
 
Method Summary
 boolean fromImage(byte[] m)
          Convert a byte array into field data.
 byte[] getValue()
          Pass the bytes to the caller.
 void setValue(byte[] data)
          Set the content based on input.
 byte[] toImage()
          Convert the field into a byte array.
 
Methods inherited from class brf.j2me.dynaworks.db.RecordField
getExpectedSize, getSize
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

content

private byte[] content
byte array as field data.
Constructor Detail

BytesField

public BytesField(int s)
Construct a record field containing a byte array.

Parameters:
s - int - size of the array.
Method Detail

getValue

public byte[] getValue()
Pass the bytes to the caller.

Returns:
byte[] - content of the value field.

setValue

public void setValue(byte[] data)
Set the content based on input.

Parameters:
data - byte[] - input data

toImage

public byte[] toImage()
Convert the field into a byte array.

Overrides:
toImage in class RecordField
Returns:
byte[] - field data.

fromImage

public boolean fromImage(byte[] m)
Convert a byte array into field data.

Overrides:
fromImage in class RecordField
Parameters:
m - byte[] - input data.
Returns:
boolean - conversion successful?