Replace ByteArrayIterator with BitGroupInputStream