afplib icon indicating copy to clipboard operation
afplib copied to clipboard

AFPInputStream does not throw away leading bytes

Open moritzfl opened this issue 3 years ago • 0 comments

If I understand the surrounding code and comment correctly, leading bytes should not be read to the buffer but skipped instead.

However, the following segment in AFPInputStream reads those bytes to the buffer: if(leadingLengthBytes > 0) read(data, 0, leadingLengthBytes); // just throw away those

If my assumption is correct and the code is changed to skip() instead of read(), the number of bytes skipped should also be considered (similar to https://github.com/yan74/afplib/issues/63)

moritzfl avatar Feb 14 '22 10:02 moritzfl