Description
Calling DecoderFactory.createBinaryDecoder(InputStream in, BinaryDecoder reuse) with reuse being a non null DirectBinaryDecoder, this DirectBinaryDecoder is simply reinitialized by a call to DirectBinaryDecoder.init which reinitializes the internal InputStream.
The problem is that the byteReader attribute of DirectBinaryDecoder is not reinitialized and still points to the previously assigned ByteBufferInputStream
The following is a proposition of correction at rev 1041110:
private ByteReader byteReader; DirectBinaryDecoder(InputStream in) { super(); init(in); } @Override public void init(InputStream in) { this.in = in; byteReader = (in instanceof ByteBufferInputStream) ? new ReuseByteReader((ByteBufferInputStream) in) : new ByteReader(); }