#vulnerable code 
                                @Test
    public void testReadWrite() {
        DirectStore ds = new DirectStore(null, 1024);
        DirectBytes db = ds.createSlice();
        RawCopier<A> aRawCopier = RawCopier.copies(A.class);
        A a = new A();
        a.i = 111;
        a.j = -222;
        a.k = 333;
        a.s = "Hello";
        aRawCopier.toBytes(a, db);
        assertEquals(12, db.position());

        assertEquals(111, db.readInt(0));
        assertEquals(-222, db.readInt(4));
        assertEquals(333, db.readInt(8));

        A a2 = new A();
        a2.i = 1;
        a2.j = 2;
        a2.k = 3;
//        printInts(a2, 28);
        db.position(0);
        aRawCopier.fromBytes(db, a2);
//        printInts(a2, 28);
        assertEquals(111, a2.i);
        assertEquals(-222, a2.j);
        assertEquals(333, a2.k);
        assertEquals(null, a2.s);
    } 
                            #location 24 
                            #vulnerability type RESOURCE_LEAK
#fixed code
                                @Test
    public void testReadWrite() {
        DirectStore ds = new DirectStore(null, 1024);
        DirectBytes db = ds.bytes();
        RawCopier<A> aRawCopier = RawCopier.copies(A.class);
        A a = new A();
        a.i = 111;
        a.j = -222;
        a.k = 333;
        a.s = "Hello";
        aRawCopier.toBytes(a, db);
        assertEquals(12, db.position());

        assertEquals(111, db.readInt(0));
        assertEquals(-222, db.readInt(4));
        assertEquals(333, db.readInt(8));

        A a2 = new A();
        a2.i = 1;
        a2.j = 2;
        a2.k = 3;
//        printInts(a2, 28);
        db.position(0);
        aRawCopier.fromBytes(db, a2);
//        printInts(a2, 28);
        assertEquals(111, a2.i);
        assertEquals(-222, a2.j);
        assertEquals(333, a2.k);
        assertEquals(null, a2.s);
    }