public class UTFConverter extends Object
| Modifier and Type | Field and Description |
|---|---|
static String |
FALSE_VALUE |
static String |
TRUE_VALUE |
| Modifier and Type | Method and Description |
|---|---|
static int |
calculateUTFLength(char[] inputArray,
int startOffset,
int endOffset)
Calculate the UTF-8 length of a character array.
|
static int |
calculateUTFLength(String inputString)
Calculate the UTF-8 length of a Java String.
|
static byte[] |
convertStringToUTF(char[] inputArray,
int startOffset,
int endOffset)
Convert a String from a character array to UTF-8.
|
static int |
convertStringToUTF(char[] inputArray,
int startOffset,
int endOffset,
byte[] resultArray)
Convert the given char[] input into UTF-8 and place in the destination buffer.
|
static byte[] |
convertStringToUTF(String inputString)
Convert a Java String to UTF-8.
|
static int |
convertStringToUTF(String inputString,
byte[] resultArray)
Convert the given char[] input into UTF-8 and place in the destination buffer.
|
static boolean |
convertUTFToBool(byte[] bytearr)
Convert the UTF-8 contents of a byte array to a boolean.
|
static double |
convertUTFToDouble(byte[] bytearr)
Convert the UTF-8 contents of a byte array to a double.
|
static float |
convertUTFToFloat(byte[] bytearr)
Convert the UTF-8 contents of a byte array of UTF-8 bytes to a float.
|
static int |
convertUTFToInt(byte[] bytearr)
Convert the UTF-8 contents of a byte array to an int.
|
static long |
convertUTFToLong(byte[] bytearr)
Convert the UTF-8 contents of a byte array to a long.
|
static String |
convertUTFToString(byte[] bytearr)
Convert the UTF-8 contents of a byte array to a Java String.
|
static int |
convertUTFToString(byte[] bytearr,
int beginOffset,
int inputLength,
char[] result)
Convert the UTF-8 contents of a byte array to a Java String.
|
public static final String TRUE_VALUE
public static final String FALSE_VALUE
public static float convertUTFToFloat(byte[] bytearr)
throws UTFDataFormatException,
NumberFormatException
bytearr - Array of bytes.UTFDataFormatException - if the UTF-8 is encoded improperlyNumberFormatException - if conversion to a number can't be donepublic static double convertUTFToDouble(byte[] bytearr)
throws UTFDataFormatException,
NumberFormatException
bytearr - Array of bytes.UTFDataFormatException - if the UTF-8 is encoded improperlyNumberFormatException - if conversion to a number can't be donepublic static boolean convertUTFToBool(byte[] bytearr)
throws UTFDataFormatException
bytearr - Array of bytes.UTFDataFormatException - if the UTF-8 is encoded improperlypublic static int convertUTFToInt(byte[] bytearr)
throws UTFDataFormatException,
NumberFormatException
bytearr - Array of bytes.UTFDataFormatException - if the UTF-8 is encoded improperlyNumberFormatException - if conversion to a number can't be donepublic static long convertUTFToLong(byte[] bytearr)
throws UTFDataFormatException,
NumberFormatException
bytearr - Array of bytes.UTFDataFormatException - if the UTF-8 is encoded improperlyNumberFormatException - if conversion to a number can't be donepublic static String convertUTFToString(byte[] bytearr) throws UTFDataFormatException
bytearr - Array of bytes.UTFDataFormatException - if the UTF-8 is encoded improperlypublic static int convertUTFToString(byte[] bytearr,
int beginOffset,
int inputLength,
char[] result)
throws UTFDataFormatException
bytearr - Array of bytes.beginOffset - Start offest to data in byte array.inputLength - Length of the data to convert.result - Character array containing the converted characters.UTFDataFormatException - if the UTF-8 is encoded improperlypublic static byte[] convertStringToUTF(String inputString)
inputString - String to convert.public static byte[] convertStringToUTF(char[] inputArray,
int startOffset,
int endOffset)
inputArray - Array of characters to convert.startOffset - Start offset in character array.endOffset - One past the last character in the array.public static int calculateUTFLength(char[] inputArray,
int startOffset,
int endOffset)
inputArray - Array of characters.startOffset - Start offset of the data in the character array.endOffset - One past the last character in the array.public static int calculateUTFLength(String inputString)
inputString - The String to calculate the length of.public static int convertStringToUTF(char[] inputArray,
int startOffset,
int endOffset,
byte[] resultArray)
inputArray - Array of characters to convert.startOffset - Start offset in character array.endOffset - One past the last character in the array.resultArray - Byte array containing the converted characters.public static int convertStringToUTF(String inputString, byte[] resultArray)
inputString - String to convert.resultArray - Byte array containing the converted characters.Copyright © 2018. All rights reserved.