(int[] expectedBytes, IonBlob value)
| 56 | |
| 57 | |
| 58 | public void checkBlob(int[] expectedBytes, IonBlob value) |
| 59 | throws NullValueException, IOException |
| 60 | { |
| 61 | assertSame(IonType.BLOB, value.getType()); |
| 62 | |
| 63 | byte[] bytes = value.getBytes(); |
| 64 | assertNotSame(expectedBytes, bytes); |
| 65 | assertEquals(expectedBytes.length, bytes.length); |
| 66 | |
| 67 | InputStream in = value.newInputStream(); |
| 68 | for (int i = 0; i < expectedBytes.length; i++) |
| 69 | { |
| 70 | String msg = "index " + i; |
| 71 | assertEquals(msg, (byte) expectedBytes[i], bytes[i]); |
| 72 | assertEquals(msg, expectedBytes[i], in.read()); |
| 73 | } |
| 74 | assertEquals("should be at EOF", -1, in.read()); |
| 75 | assertEquals("should be at EOF", -1, in.read()); |
| 76 | assertEquals("should be at EOF", -1, in.read()); |
| 77 | } |
| 78 | |
| 79 | public void checkBlob(byte[] expectedBytes, IonBlob value) |
| 80 | throws NullValueException, IOException |
no test coverage detected