mirror of
https://github.com/corda/corda.git
synced 2025-02-11 21:26:23 +00:00
add new constructor to the String :
public String(byte bytes[], int offset, int length, String charsetName) throws UnsupportedEncodingException;
This commit is contained in:
parent
8c68bc0e1b
commit
8411cfbe8f
@ -32,6 +32,13 @@ public final class String implements Comparable<String>, CharSequence {
|
||||
this(data, 0, data.length);
|
||||
}
|
||||
|
||||
public String(byte bytes[], int offset, int length, String charsetName) throws UnsupportedEncodingException {
|
||||
this(bytes, offset, length);
|
||||
if (!charsetName.equals("UTF-8")) {
|
||||
throw new UnsupportedEncodingException(charsetName);
|
||||
}
|
||||
}
|
||||
|
||||
public String(byte[] data, int offset, int length, boolean copy) {
|
||||
this((Object) data, offset, length, copy);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user