Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
None
-
None
-
None
-
Patch Available
Description
RI throws SerialException when both parameters in SerialBlob.getBytes(long pos, int len) are valid.
Consider following code:
public void testGetBytesJI1() throws Exception {
byte[] buf =
;
SerialBlob serialBlob = new SerialBlob(buf);
byte [] data = serialBlob.getBytes(2, 1);
assertEquals(1, data.length);
assertEquals(2, data[0]);
}
Harmony passes the test, while RI throws SerialException with message "Invalid arguments: position cannot be less that 1". As discussed in mailing list, Harmony's behaviour is reasonable, and it's non bug different from RI.
Best regards,
Andrew