Package nom.tam.util
Class AsciiFuncs
- java.lang.Object
-
- nom.tam.util.AsciiFuncs
-
public final class AsciiFuncs extends java.lang.Object
-
-
Field Summary
Fields Modifier and Type Field Description private static java.nio.charset.Charset
US_ASCII
-
Constructor Summary
Constructors Modifier Constructor Description private
AsciiFuncs()
utility class not to be instantiated.
-
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)
-
-
-
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 fromstart
- the position where the string startslen
- 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.
-
-