Use writeBit instead of write
Add a bit output that saves its stuff to a ByteBuffer and can be rewound to a specific bit