code: public String readString(final String charset) throws IOException {
          byte ch;
          int cnt = 0;
          final byte [] byteArrBuff = new byte[byteBuffer.remaining()];
          while (byteBuffer.remaining() > 0 && ((ch = byteBuffer.get()) != 0)) {
              byteArrBuff[cnt++] = ch;
          }
          return new String(byteArrBuff,0,cnt);
      }
docs: Reads a string from the buffer, looks for a 0 to end the string
  
  @param charset the charset to use, for example ASCII
  @return the read string
  @throws java.io.IOException if it is not possible to create the string from the buffer