java.lang.Object | |
↳ | org.apache.commons.codec.binary.StringUtils |
Converts String to and from bytes using the encodings required by the Java specification. These encodings are specified in Standard charsets
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Encodes the given string into a sequence of bytes using the ISO-8859-1 charset, storing the result into a new
byte array.
| |||||||||||
Encodes the given string into a sequence of bytes using the named charset, storing the result into a new byte
array.
| |||||||||||
Encodes the given string into a sequence of bytes using the US-ASCII charset, storing the result into a new byte
array.
| |||||||||||
Encodes the given string into a sequence of bytes using the UTF-16 charset, storing the result into a new byte
array.
| |||||||||||
Encodes the given string into a sequence of bytes using the UTF-16BE charset, storing the result into a new byte
array.
| |||||||||||
Encodes the given string into a sequence of bytes using the UTF-16LE charset, storing the result into a new byte
array.
| |||||||||||
Encodes the given string into a sequence of bytes using the UTF-8 charset, storing the result into a new byte
array.
| |||||||||||
Constructs a new
String by decoding the specified array of bytes using the given charset. | |||||||||||
Constructs a new
String by decoding the specified array of bytes using the ISO-8859-1 charset. | |||||||||||
Constructs a new
String by decoding the specified array of bytes using the US-ASCII charset. | |||||||||||
Constructs a new
String by decoding the specified array of bytes using the UTF-16 charset. | |||||||||||
Constructs a new
String by decoding the specified array of bytes using the UTF-16BE charset. | |||||||||||
Constructs a new
String by decoding the specified array of bytes using the UTF-16LE charset. | |||||||||||
Constructs a new
String by decoding the specified array of bytes using the UTF-8 charset. |
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
|
Encodes the given string into a sequence of bytes using the ISO-8859-1 charset, storing the result into a new byte array.
string | the String to encode |
---|
IllegalStateException | Thrown when the charset is missing, which should be never according the the Java specification. |
---|
Encodes the given string into a sequence of bytes using the named charset, storing the result into a new byte array.
This method catches UnsupportedEncodingException and rethrows it as IllegalStateException, which should never happen for a required charset name. Use this method when the encoding is required to be in the JRE.
string | the String to encode |
---|---|
charsetName | The name of a required java.nio.charset.Charset |
IllegalStateException | Thrown when a UnsupportedEncodingException is caught, which should never happen for a required charset name. |
---|
Encodes the given string into a sequence of bytes using the US-ASCII charset, storing the result into a new byte array.
string | the String to encode |
---|
IllegalStateException | Thrown when the charset is missing, which should be never according the the Java specification. |
---|
Encodes the given string into a sequence of bytes using the UTF-16 charset, storing the result into a new byte array.
string | the String to encode |
---|
IllegalStateException | Thrown when the charset is missing, which should be never according the the Java specification. |
---|
Encodes the given string into a sequence of bytes using the UTF-16BE charset, storing the result into a new byte array.
string | the String to encode |
---|
IllegalStateException | Thrown when the charset is missing, which should be never according the the Java specification. |
---|
Encodes the given string into a sequence of bytes using the UTF-16LE charset, storing the result into a new byte array.
string | the String to encode |
---|
IllegalStateException | Thrown when the charset is missing, which should be never according the the Java specification. |
---|
Encodes the given string into a sequence of bytes using the UTF-8 charset, storing the result into a new byte array.
string | the String to encode |
---|
IllegalStateException | Thrown when the charset is missing, which should be never according the the Java specification. |
---|
Constructs a new String
by decoding the specified array of bytes using the given charset.
This method catches UnsupportedEncodingException and re-throws it as IllegalStateException, which should never happen for a required charset name. Use this method when the encoding is required to be in the JRE.
bytes | The bytes to be decoded into characters |
---|---|
charsetName | The name of a required java.nio.charset.Charset |
String
decoded from the specified array of bytes using the given charset.IllegalStateException | Thrown when a UnsupportedEncodingException is caught, which should never happen for a required charset name. |
---|
Constructs a new String
by decoding the specified array of bytes using the ISO-8859-1 charset.
bytes | The bytes to be decoded into characters |
---|
String
decoded from the specified array of bytes using the given charset.IllegalStateException | Thrown when a UnsupportedEncodingException is caught, which should never happen since the charset is required. |
---|
Constructs a new String
by decoding the specified array of bytes using the US-ASCII charset.
bytes | The bytes to be decoded into characters |
---|
String
decoded from the specified array of bytes using the given charset.IllegalStateException | Thrown when a UnsupportedEncodingException is caught, which should never happen since the charset is required. |
---|
Constructs a new String
by decoding the specified array of bytes using the UTF-16 charset.
bytes | The bytes to be decoded into characters |
---|
String
decoded from the specified array of bytes using the given charset.IllegalStateException | Thrown when a UnsupportedEncodingException is caught, which should never happen since the charset is required. |
---|
Constructs a new String
by decoding the specified array of bytes using the UTF-16BE charset.
bytes | The bytes to be decoded into characters |
---|
String
decoded from the specified array of bytes using the given charset.IllegalStateException | Thrown when a UnsupportedEncodingException is caught, which should never happen since the charset is required. |
---|
Constructs a new String
by decoding the specified array of bytes using the UTF-16LE charset.
bytes | The bytes to be decoded into characters |
---|
String
decoded from the specified array of bytes using the given charset.IllegalStateException | Thrown when a UnsupportedEncodingException is caught, which should never happen since the charset is required. |
---|
Constructs a new String
by decoding the specified array of bytes using the UTF-8 charset.
bytes | The bytes to be decoded into characters |
---|
String
decoded from the specified array of bytes using the given charset.IllegalStateException | Thrown when a UnsupportedEncodingException is caught, which should never happen since the charset is required. |
---|