@Override
    public int available() throws IOException {
      ByteBuffer bb = data;
      if (bb == null) {
        return 0;
      } else {
        return bb.remaining();
      }
    }
See the InputStream read method for javadocs. Note that if an attempt to read past the end of
the wrapped ByteBuffer is done this method throws BufferUnderflowException
geode-core/src/main/java/org/apache/geode/internal/tcp/MsgDestreamer.java