You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The AFPInputStream throws an AfpFormatException("premature end of file.") if the first or second byte of the structured field length is 0xFF.
If the first byte is a 0xFF the file is "broken" of course, but the second byte can be 0xFF... In my test case I have a file where a record begins with 5A1FFF
The fix is quite simple... In AFPInputStream please have a look at the method read. Just replace return header[(int) offset]; with return header[(int) offset] & 0xff;
bye,
Michael
The text was updated successfully, but these errors were encountered:
The
AFPInputStream
throws anAfpFormatException("premature end of file.")
if the first or second byte of the structured field length is 0xFF.If the first byte is a 0xFF the file is "broken" of course, but the second byte can be 0xFF... In my test case I have a file where a record begins with
5A1FFF
The fix is quite simple... In
AFPInputStream
please have a look at the methodread
. Just replacereturn header[(int) offset];
withreturn header[(int) offset] & 0xff;
bye,
Michael
The text was updated successfully, but these errors were encountered: