File tree Expand file tree Collapse file tree 2 files changed +5
-7
lines changed
src/test/java/org/lmdbjava Expand file tree Collapse file tree 2 files changed +5
-7
lines changed Original file line number Diff line number Diff line change 6262import java .util .concurrent .TimeoutException ;
6363import java .util .concurrent .atomic .AtomicBoolean ;
6464import java .util .function .*;
65- import org .agrona .concurrent .UnsafeBuffer ;
6665import org .hamcrest .Matchers ;
6766import org .junit .After ;
6867import org .junit .Before ;
@@ -381,7 +380,7 @@ public void putCommitGetByteArray() throws IOException {
381380 try (Txn <byte []> txn = envBa .txnWrite ()) {
382381 final byte [] found = db .get (txn , ba (5 ));
383382 assertNotNull (found );
384- assertThat (new UnsafeBuffer (txn .val ()). getInt ( 0 ), is (5 ));
383+ assertThat (fromBa (txn .val ()), is (5 ));
385384 }
386385 }
387386 }
Original file line number Diff line number Diff line change @@ -36,14 +36,13 @@ final class TestUtils {
3636 private TestUtils () {}
3737
3838 static byte [] ba (final int value ) {
39- final MutableDirectBuffer b = new UnsafeBuffer ( new byte [4 ]) ;
40- b . putInt (0 , value );
41- return b . byteArray () ;
39+ byte [] bytes = new byte [4 ];
40+ ByteBuffer . wrap ( bytes ). putInt (value );
41+ return bytes ;
4242 }
4343
4444 static int fromBa (final byte [] ba ) {
45- final MutableDirectBuffer b = new UnsafeBuffer (ba );
46- return b .getInt (0 );
45+ return ByteBuffer .wrap (ba ).getInt ();
4746 }
4847
4948 static ByteBuffer bb (final int value ) {
You can’t perform that action at this time.
0 commit comments