nl.knaw.dans.common.dbflib
Class ByteArrayValue

java.lang.Object
  extended by nl.knaw.dans.common.dbflib.Value
      extended by nl.knaw.dans.common.dbflib.ByteArrayValue

public class ByteArrayValue
extends Value

Represents a binary value in a record. The typed and untyped values are both the same byte array.

Author:
Jan van Mansum

Field Summary
 
Fields inherited from class nl.knaw.dans.common.dbflib.Value
typed
 
Constructor Summary
ByteArrayValue(byte[] byteArrayValue)
          Creates a new ByteArrayValue object.
 
Method Summary
protected  byte[] doGetRawValue(Field field)
          Converts the typed value to a byte array, according to the field specifications provided.
protected  Object doGetTypedValue(byte[] rawValue)
          Converts the raw bytes to a Java object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ByteArrayValue

public ByteArrayValue(byte[] byteArrayValue)
Creates a new ByteArrayValue object.

Parameters:
byteArrayValue - the byte array value
Method Detail

doGetTypedValue

protected Object doGetTypedValue(byte[] rawValue)
Description copied from class: Value
Converts the raw bytes to a Java object. The class of Java object to create is determined by the subclass of Value.

Specified by:
doGetTypedValue in class Value
Returns:
the value as a Java object

doGetRawValue

protected byte[] doGetRawValue(Field field)
                        throws ValueTooLargeException
Description copied from class: Value
Converts the typed value to a byte array, according to the field specifications provided.

Specified by:
doGetRawValue in class Value
Parameters:
field - the field specifications
Returns:
a byte array containing the raw value
Throws:
ValueTooLargeException - if the value is too large for the field


Copyright © 2009-2012 DANS. All Rights Reserved.