public void align() throws IOException {
        int zeros = (-getPosition()) & 3;
        if (zeros > 0) {
            write(zeroBuf, 0, zeros);
        }
    }
@Test
    public void testAlign() throws IOException {
        // create a new writer so we can start at file position 0
        startPosition = 0;
        writer = new DexDataWriter(output, startPosition, 256);

        writer.align();
        writer.write(1);
        writer.align();
        writer.align();

        writer.write(1);
        writer.write(2);
        writer.align();

        writer.write(1);
        writer.write(2);
        writer.write(3);
        writer.align();
        writer.align();

        writer.write(1);
        writer.write(2);
        writer.write(3);
        writer.write(4);
        writer.align();
        writer.align();
        writer.align();
        writer.align();

        writer.write(1);
        writer.align();

        expectData(0x01, 0x00, 0x00, 0x00,
                   0x01, 0x02, 0x00, 0x00,
                   0x01, 0x02, 0x03, 0x00,
                   0x01, 0x02, 0x03, 0x04,
                   0x01, 0x00, 0x00, 0x00);
    }