public static String readString ( ByteBuf bf ) { byte [ ] bytes = readRangedBytes ( bf ) ; return bytes . length > 0 ? new String ( bytes , CharsetUtil . UTF_8 ) : "" ; }
Reads length of String and then returns an UTF - 8 formatted String of such length . If the length is 0 an empty String is returned .