Class LeftPadder
java.lang.Object
org.jpos.iso.LeftPadder
- All Implemented Interfaces:
Padder
Implements the Padder interface for padding strings and byte arrays on the
left.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
-
Field Details
-
ZERO_PADDER
A padder for padding zeros on the left. This is very common in numeric fields.
-
-
Constructor Details
-
LeftPadder
Creates a Left Padder with a specific pad character.- Parameters:
pad- The padding character. For binary padders, the pad character is truncated to lower order byte.
-
-
Method Details
-
pad
Description copied from interface:PadderReturns a padded string upto a maximum length. If the data is longer than maxLength, then the data is truncated.- Specified by:
padin interfacePadder- Parameters:
data- The string to pad.maxLength- The maximum length of the padded string.- Returns:
- A padded string.
- Throws:
ISOException- on error
-
unpad
-