mirror of
https://github.com/corda/corda.git
synced 2025-06-13 04:38:19 +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:
@ -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);
|
||||
}
|
||||
|
Reference in New Issue
Block a user