NativeXAFileInputStream.read method returns prematurely

33 views
Skip to first unread message

Miloslav Fritz

unread,
Feb 3, 2015, 8:35:50 AM2/3/15
to xad...@googlegroups.com
Hello,

we have a problem with reading a binary files using XADisk's NativeXAFileInputStream.
Problem is that anytime in the binary file appears a FF character (represented as -1 as byte), the stream is just closed, because it is considered as EOF.

Looking at the sources it seems that in NativeXAFileInputStream.java in some places, there is wrong up-casting from byte to int.
It should be:

byte b = -1;
int a = b & 0xFF;

I think this is a bug, I wonder that nobody came into this yet ?

Thanks,
Milo

Nitin Verma

unread,
Feb 3, 2015, 3:06:22 PM2/3/15
to xad...@googlegroups.com, m...@miloslavfritz.com
Hi Milo,

Yes, I confirmed that it is a bug. Here is the tracking bug, I am checking in the fix too: https://java.net/jira/browse/XADISK-171.

Thanks & Regards,
Nitin

Reply all
Reply to author
Forward
0 new messages