Fixed broken Utf8Old.java
This would not correctly encode/decode strings when substituted for the default Utf8Safe.java Change-Id: Ib303697663b5b8cbf6888492f5255b2a45384c04
This commit is contained in:
parent
9fb195cce8
commit
ff1a22a05f
|
@ -67,6 +67,7 @@ public class Utf8Old extends Utf8 {
|
||||||
throw new IllegalArgumentException("bad character encoding", e);
|
throw new IllegalArgumentException("bad character encoding", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
cache.lastOutput.flip();
|
||||||
return cache.lastOutput.remaining();
|
return cache.lastOutput.remaining();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -90,7 +91,6 @@ public class Utf8Old extends Utf8 {
|
||||||
buffer.limit(offset + length);
|
buffer.limit(offset + length);
|
||||||
try {
|
try {
|
||||||
CharBuffer result = decoder.decode(buffer);
|
CharBuffer result = decoder.decode(buffer);
|
||||||
result.flip();
|
|
||||||
return result.toString();
|
return result.toString();
|
||||||
} catch (CharacterCodingException e) {
|
} catch (CharacterCodingException e) {
|
||||||
throw new IllegalArgumentException("Bad encoding", e);
|
throw new IllegalArgumentException("Bad encoding", e);
|
||||||
|
|
Loading…
Reference in New Issue