Package org.apache.kerby.xdr.type
Class XdrString
- All Implemented Interfaces:
XdrType
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic char[]asCharArray(byte[] bytes) Do a simple conversion of an array of 8 bit characters into a string.protected intLength including null bytes to maintain an multiple of 4.static StringfromByteArray(byte[] bytes) Convert an array of 8 bit characters into a string.static StringfromUTF8ByteArray(byte[] bytes) intvoidsetPadding(int padding) static String[]static byte[]toByteArray(char[] chars) static byte[]toByteArray(String string) protected voidtoBytes()Encode simple type to bytes.static StringtoLowerCase(String string) A locale independent version of toLowerCase.static StringtoUpperCase(String string) A locale independent version of toUpperCase.static byte[]toUTF8ByteArray(char[] string) static voidtoUTF8ByteArray(char[] string, OutputStream sOut) static byte[]toUTF8ByteArray(String string) protected voidtoValue()Decode bytes to simple value.Methods inherited from class org.apache.kerby.xdr.type.XdrSimple
decode, decodeBody, encodeBody, encodeBody, getBytes, isSimple, setBytesMethods inherited from class org.apache.kerby.xdr.type.AbstractXdrType
decode, encode, encode, encodingLength, getDataType, getValue, setValue
-
Constructor Details
-
XdrString
public XdrString() -
XdrString
-
-
Method Details
-
toBytes
protected void toBytes()Description copied from class:XdrSimpleEncode simple type to bytes. -
encodingBodyLength
protected int encodingBodyLength()Description copied from class:XdrSimpleLength including null bytes to maintain an multiple of 4.- Overrides:
encodingBodyLengthin classXdrSimple<String>- Returns:
- The encoding body length
-
toValue
Description copied from class:XdrSimpleDecode bytes to simple value.- Specified by:
toValuein classXdrSimple<String>- Throws:
IOException
-
setPadding
public void setPadding(int padding) -
getPadding
public int getPadding() -
fromUTF8ByteArray
-
toUTF8ByteArray
-
toUTF8ByteArray
public static byte[] toUTF8ByteArray(char[] string) -
toUTF8ByteArray
- Throws:
IOException
-
toUpperCase
A locale independent version of toUpperCase.- Parameters:
string- input to be converted- Returns:
- a US Ascii uppercase version
-
toLowerCase
A locale independent version of toLowerCase.- Parameters:
string- input to be converted- Returns:
- a US ASCII lowercase version
-
toByteArray
public static byte[] toByteArray(char[] chars) -
toByteArray
-
fromByteArray
Convert an array of 8 bit characters into a string.- Parameters:
bytes- 8 bit characters.- Returns:
- resulting String.
-
asCharArray
public static char[] asCharArray(byte[] bytes) Do a simple conversion of an array of 8 bit characters into a string.- Parameters:
bytes- 8 bit characters.- Returns:
- resulting String.
-
split
-