Package jcifs.util

Class Strings


  • public final class Strings
    extends Object
    Author:
    mbechler
    • 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