Closed
Description
Describe the bug
When writing a single ascii character using ByteBufferOutput.writeAscii, reading will fail with an exception.
To Reproduce
public static void main(String[] args) {
var os = new ByteArrayOutputStream();
try (ByteBufferOutput out = new ByteBufferOutput(os)) {
out.writeAscii("A");
out.flush();
}
try (ByteBufferInput input = new ByteBufferInput(os.toByteArray())) {
System.out.println(input.readString());
}
}
Environment:
- OS: [Windows]
- JDK Version: [JDK18]
- Kryo Version: [e.g. 5.3.0]
Additional context
If I replace "A" with "AB" in the sample code above it works just fine. It also works if I use UnsafeInput/UnsafeOutput instead of ByteBufferOutput/ByteBufferInput