Package nom.tam.util

Class AsciiFuncs

java.lang.Object
nom.tam.util.AsciiFuncs

public final class AsciiFuncs extends Object
  • Field Details

    • US_ASCII

      private static final Charset US_ASCII
  • Constructor Details

    • AsciiFuncs

      private AsciiFuncs()
      utility class not to be instantiated.
  • Method Details

    • asciiString

      public static String asciiString(byte[] buf)
      Convert to ASCII or return null if not compatible.
      Parameters:
      buf - the bytes representing a string
      Returns:
      the String represented by the bytes
    • asciiString

      public static String asciiString(byte[] buf, int start, int len)
      Convert to ASCII or return null if not compatible.
      Parameters:
      buf - buffer to get the string bytes from
      start - the position where the string starts
      len - the length of the string
      Returns:
      the extracted string
    • getBytes

      public static byte[] getBytes(String in)
      Convert an ASCII string to bytes.
      Parameters:
      in - the string to convert
      Returns:
      the string converted to bytes
    • isWhitespace

      public static boolean isWhitespace(char character)
      Parameters:
      character - the charater to check
      Returns:
      true is the character is a whitespace.