|
9 | 9 | * %%
|
10 | 10 | * Redistribution and use in source and binary forms, with or without
|
11 | 11 | * modification, are permitted provided that the following conditions are met:
|
12 |
| - * |
| 12 | + * |
13 | 13 | * 1. Redistributions of source code must retain the above copyright notice,
|
14 | 14 | * this list of conditions and the following disclaimer.
|
15 | 15 | * 2. Redistributions in binary form must reproduce the above copyright notice,
|
16 | 16 | * this list of conditions and the following disclaimer in the documentation
|
17 | 17 | * and/or other materials provided with the distribution.
|
18 |
| - * |
| 18 | + * |
19 | 19 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
20 | 20 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
21 | 21 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
@@ -68,6 +68,17 @@ public void testSetGetBytesArray() {
|
68 | 68 | assertEqualRead(testBytes.length - 4, 2);
|
69 | 69 | }
|
70 | 70 |
|
| 71 | + @Test |
| 72 | + public void testToByteArray() { |
| 73 | + // read in full array |
| 74 | + bank.setBytes(0l, testBytes.clone(), 0, testBytes.length); |
| 75 | + |
| 76 | + assertArrayEquals(testBytes, bank.toByteArray()); |
| 77 | + |
| 78 | + byte[] actuals = bank.toByteArray(0, testBytes.length); |
| 79 | + assertArrayEquals(actuals, testBytes); |
| 80 | + } |
| 81 | + |
71 | 82 | @Test
|
72 | 83 | public void testSetGetBytesPartialArray() {
|
73 | 84 | // read in the partial array
|
|
0 commit comments