Package nom.tam.util

Class AsciiFuncs


  • public final class AsciiFuncs
    extends java.lang.Object
    Author:
    tmcglynn
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.lang.String asciiString​(byte[] buf)
      Convert to ASCII or return null if not compatible.
      static java.lang.String asciiString​(byte[] buf, int start, int len)
      Convert to ASCII or return null if not compatible.
      static byte[] getBytes​(java.lang.String in)
      Convert an ASCII string to bytes.
      static boolean isWhitespace​(char character)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • asciiString

        public static java.lang.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 java.lang.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​(java.lang.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.