Interface Padder

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

public interface Padder
An interface for padding and unpadding strings and byte arrays.
  • Method Summary

    Modifier and Type
    Method
    Description
    pad(String data, int maxLength)
    Returns a padded string upto a maximum length.
    unpad(String paddedData)
    Removes the padding from a padded string.
  • Method Details

    • 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