Closed GladeDiviney closed 6 years ago
After further review it's required to use BufferedInputStream
due to the need to mark/reset.
But what we can do is move the key packet parsing code to IppPacketStream which can be used by transports to extract a packet. The remainder of unread data can then be accessed from the original stream.
Currently IppInputStream is defined as a subclass of
DataInputStream(BufferedInputStream(inputStream))
. The effect is to draw off an 8k buffer frominputStream
, most of which won't be read as IPP packets are usually smaller. This makes it difficult to recover the remainder of the stream when it contains a document.