public static Optional<String> readOptString(ByteBuf bf) {
      Optional<byte[]> bytes = readOptRangedBytes(bf);
      return bytes.map(b -> new String(b, CharsetUtil.UTF_8));
   }
public static Optional < String > readOptString ( ByteBuf bf ) { Optional < byte [ ] > bytes = readOptRangedBytes ( bf ) ; return bytes . map ( b -> new String ( b , CharsetUtil . UTF_8 ) ) ; }
Reads an optional String. 0 length is an empty string, negative length is translated to None.