net.sourceforge.plantuml.code.ByteArray Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of plantuml-mit Show documentation
Show all versions of plantuml-mit Show documentation
PlantUML is a component that allows to quickly write diagrams from text.
// THIS FILE HAS BEEN GENERATED BY A PREPROCESSOR.
package net.sourceforge.plantuml.code;
import static java.nio.charset.StandardCharsets.UTF_8;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
public class ByteArray {
private final byte data[];
private final int length;
private ByteArray(byte data[], int length) {
this.data = data;
this.length = length;
}
public static ByteArray from(byte[] input) {
return new ByteArray(input, input.length);
}
public String toUFT8String() throws UnsupportedEncodingException {
return new String(data, 0, length, UTF_8);
}
// ::comment when __CORE__
public String toUPF9String() throws IOException {
return Upf9Decoder.decodeString(data, length);
}
public int getByteAt(int i) {
return data[i];
}
public int length() {
return length;
}
}