com.servingxml.components.flatfile.layout
Class SizeSignatureMethod

java.lang.Object
  extended by com.servingxml.components.flatfile.layout.SizeSignatureMethod
All Implemented Interfaces:
SignatureMethod

public class SizeSignatureMethod
extends java.lang.Object
implements SignatureMethod


Constructor Summary
SizeSignatureMethod()
           
 
Method Summary
 void data(byte[] bytes, int start, int length)
          Receive notification of raw data from body of flat file.
 Value getSignature()
          Gets the value of the signature calculated in the data method
 void validate(Value expectedValue)
          Receive notification to validate the computed file signature against its expected value
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SizeSignatureMethod

public SizeSignatureMethod()
Method Detail

data

public void data(byte[] bytes,
                 int start,
                 int length)
Description copied from interface: SignatureMethod
Receive notification of raw data from body of flat file.

Data may be received in a single chunk or in multiple chunks.

Specified by:
data in interface SignatureMethod
Parameters:
bytes - the bytes from the body of the flat file.
start - the start position in the array
length - the number of characters to read from the array

validate

public void validate(Value expectedValue)
Description copied from interface: SignatureMethod
Receive notification to validate the computed file signature against its expected value

Specified by:
validate in interface SignatureMethod
Parameters:
expectedValue - the expected value of the file signature

getSignature

public Value getSignature()
Description copied from interface: SignatureMethod
Gets the value of the signature calculated in the data method

Specified by:
getSignature in interface SignatureMethod
Returns:
the signature value