mirror of
https://github.com/Eaglercraft-TeaVM-Fork/eagler-teavm.git
synced 2024-12-22 08:14:09 -08:00
Fixed issue https://github.com/konsoletyper/teavm/issues/100
This commit is contained in:
parent
8a9ea907ed
commit
ff9324570c
|
@ -240,13 +240,14 @@ public class TDataInputStream extends TFilterInputStream implements TDataInput {
|
||||||
int a;
|
int a;
|
||||||
while (count < utfSize) {
|
while (count < utfSize) {
|
||||||
char ch = (char)buf[offset + count++];
|
char ch = (char)buf[offset + count++];
|
||||||
|
out[s] = ch;
|
||||||
if (ch < '\u0080') {
|
if (ch < '\u0080') {
|
||||||
out[s++] = ch;
|
s++;
|
||||||
} else if (((a = out[s]) & 0xe0) == 0xc0) {
|
} else if (((a = out[s]) & 0xe0) == 0xc0) {
|
||||||
if (count >= utfSize) {
|
if (count >= utfSize) {
|
||||||
throw new TUTFDataFormatException(TString.wrap("End of stream reached"));
|
throw new TUTFDataFormatException(TString.wrap("End of stream reached"));
|
||||||
}
|
}
|
||||||
int b = buf[count++];
|
int b = buf[offset + count++];
|
||||||
if ((b & 0xC0) != 0x80) {
|
if ((b & 0xC0) != 0x80) {
|
||||||
throw new TUTFDataFormatException(TString.wrap("Malformed UTF-8 sequence"));
|
throw new TUTFDataFormatException(TString.wrap("Malformed UTF-8 sequence"));
|
||||||
}
|
}
|
||||||
|
@ -255,8 +256,8 @@ public class TDataInputStream extends TFilterInputStream implements TDataInput {
|
||||||
if (count + 1 >= utfSize) {
|
if (count + 1 >= utfSize) {
|
||||||
throw new TUTFDataFormatException(TString.wrap("Malformed UTF-8 sequence"));
|
throw new TUTFDataFormatException(TString.wrap("Malformed UTF-8 sequence"));
|
||||||
}
|
}
|
||||||
int b = buf[count++];
|
int b = buf[offset + count++];
|
||||||
int c = buf[count++];
|
int c = buf[offset + count++];
|
||||||
if (((b & 0xC0) != 0x80) || ((c & 0xC0) != 0x80)) {
|
if (((b & 0xC0) != 0x80) || ((c & 0xC0) != 0x80)) {
|
||||||
throw new TUTFDataFormatException(TString.wrap("Malformed UTF-8 sequence"));
|
throw new TUTFDataFormatException(TString.wrap("Malformed UTF-8 sequence"));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user