The close() method should automatically align the reader/writerIndex to the next byte, flushing the last byte to the underlying ByteBuf if it is a writer.
I don't think it's worth automatically generating the ByteBuf extension class: although there are lots of theoretical combinations for the add/sub/complement methods, few of them are actually present in the client's buffer class. We should just base our selection of methods on the methods present in the client.
I think we need three classes: a class with extra static methods for `ByteBuf` and a `BitBuf` class, usable like so:
```java
try (var bitBuf = new BitBuf(buf)) {
bitBuf.putBits(8, 123);
// ...
}
```
The `close()` method should automatically align the reader/writerIndex to the next byte, flushing the last byte to the underlying `ByteBuf` if it is a writer.
I don't think it's worth automatically generating the `ByteBuf` extension class: although there are lots of theoretical combinations for the add/sub/complement methods, few of them are actually present in the client's buffer class. We should just base our selection of methods on the methods present in the client.
I think we need three classes: a class with extra static methods for
ByteBuf
and aBitBuf
class, usable like so:The
close()
method should automatically align the reader/writerIndex to the next byte, flushing the last byte to the underlyingByteBuf
if it is a writer.I don't think it's worth automatically generating the
ByteBuf
extension class: although there are lots of theoretical combinations for the add/sub/complement methods, few of them are actually present in the client's buffer class. We should just base our selection of methods on the methods present in the client.Pretty much done now.