code: public static Optional<Optional<byte[]>> readMaybeOptRangedBytes(ByteBuf bf) {
        Optional<Integer> l = readMaybeSignedInt(bf);
        if (l.isPresent()) {
           int length = l.get();
           if (length < 0) {
              return Optional.of(Optional.empty());
           } else {
              Optional<byte[]> rb = readMaybeRangedBytes(bf, length);
              if (rb.isPresent()) {
                 return Optional.of(rb);
              } else {
                 return Optional.empty();
              }
           }
        } else {
           return Optional.empty();
        }
     }
docs: Read a range of bytes prefixed by its length (encoded as a signed VInt).
  
  @return {@code Optional(Optional(byte[])} if it could read the range,
  {@code Optional(Optional.empty())} if the length was negative,
  or {@code Optional.empty()} if the input buffer didn't contain the entire range.