Package jcifs.util
Class Strings
- java.lang.Object
-
- jcifs.util.Strings
-
public final class Strings extends Object
- Author:
- mbechler
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static int
findTermination(byte[] buffer, int bufferIndex, int maxLen)
static int
findUNITermination(byte[] buffer, int bufferIndex, int maxLen)
static String
fromOEMBytes(byte[] src, int srcIndex, int len, Configuration config)
static String
fromUNIBytes(byte[] src, int srcIndex, int len)
static byte[]
getASCIIBytes(String str)
static byte[]
getBytes(String str, Charset encoding)
static byte[]
getOEMBytes(String str, Configuration config)
static byte[]
getUNIBytes(String str)
-
-
-
Method Detail
-
getBytes
public static byte[] getBytes(String str, Charset encoding)
- Parameters:
str
-encoding
-- Returns:
- encoded
-
getUNIBytes
public static byte[] getUNIBytes(String str)
- Parameters:
str
-- Returns:
- the string as bytes (UTF16-LE)
-
getASCIIBytes
public static byte[] getASCIIBytes(String str)
- Parameters:
str
-- Returns:
- the string as bytes (ASCII)
-
getOEMBytes
public static byte[] getOEMBytes(String str, Configuration config)
- Parameters:
str
-config
-- Returns:
- the string as bytes
-
fromUNIBytes
public static String fromUNIBytes(byte[] src, int srcIndex, int len)
- Parameters:
src
-srcIndex
-len
-- Returns:
- decoded string
-
findUNITermination
public static int findUNITermination(byte[] buffer, int bufferIndex, int maxLen)
- Parameters:
buffer
-bufferIndex
-maxLen
-- Returns:
- position of terminating null bytes
-
fromOEMBytes
public static String fromOEMBytes(byte[] src, int srcIndex, int len, Configuration config)
- Parameters:
src
-srcIndex
-len
-config
-- Returns:
- decoded string
-
findTermination
public static int findTermination(byte[] buffer, int bufferIndex, int maxLen)
- Parameters:
buffer
-bufferIndex
-maxLen
-- Returns:
- position of terminating null byte
-
-