net.sourceforge.sqlunit.types
Class ByteArrayType

java.lang.Object
  extended by net.sourceforge.sqlunit.types.UnsupportedType
      extended by net.sourceforge.sqlunit.types.ByteArrayType
All Implemented Interfaces:
java.lang.Comparable, IType

public class ByteArrayType
extends UnsupportedType

Models a Binary type. This is similar to BinaryType but will read from a supplied byte array instead of a Binary InputStream. It will convert to a MD5 digest and can be specified either as a MD5 digest (prefixed by md5:) or a file name (prefixed by file:).

Version:
$Revision: 1.11 $
Author:
Ralph Brendler (rbrendler@users.sourceforge.net), Sujit Pal (spal@users.sourceforge.net)

Constructor Summary
ByteArrayType()
           
 
Method Summary
protected  java.lang.String format(java.lang.Object obj)
          Formats a ByteArray into its string representation.
protected  java.lang.String formatString(java.lang.String obj)
          Defines behavior that is activated when the passed in Object is a String.
 
Methods inherited from class net.sourceforge.sqlunit.types.UnsupportedType
compareTo, equals, getId, getName, getValue, hashCode, parse, setId, setName, setValue, toObject, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ByteArrayType

public ByteArrayType()
Method Detail

formatString

protected java.lang.String formatString(java.lang.String obj)
                                 throws SQLUnitException
Defines behavior that is activated when the passed in Object is a String.

Overrides:
formatString in class UnsupportedType
Parameters:
obj - the String to convert.
Returns:
a converted String.
Throws:
SQLUnitException - if there was a problem.

format

protected java.lang.String format(java.lang.Object obj)
                           throws SQLUnitException
Formats a ByteArray into its string representation.

Overrides:
format in class UnsupportedType
Parameters:
obj - an Object to be converted to the IType interface.
Returns:
the String representation of the object.
Throws:
SQLUnitException - if the formatting failed.