org.jpos.iso
Interface Padder

All Known Implementing Classes:
LeftPadder, NullPadder, RightPadder, RightTPadder

public interface Padder

An interface for padding and unpadding strings and byte arrays.

Version:
$Revision$ $Date$
Author:
joconnor

Method Summary
 String pad(String data, int maxLength)
          Returns a padded string upto a maximum length.
 String unpad(String paddedData)
          Removes the padding from a padded string.
 

Method Detail

pad

String pad(String data,
           int maxLength)
           throws ISOException
Returns a padded string upto a maximum length. If the data is longer than maxLength, then the data is truncated.

Parameters:
data - The string to pad.
maxLength - The maximum length of the padded string.
Returns:
A padded string.
Throws:
ISOException - on error

unpad

String unpad(String paddedData)
             throws ISOException
Removes the padding from a padded string.

Parameters:
paddedData - The string to unpad.
Returns:
The unpadded string.
Throws:
ISOException - on error


Copyright © 1998-2012 jPOS.org. All Rights Reserved.