DistributionMessage readMessage(Header header)
      throws IOException, ClassNotFoundException {
    try (final ByteBufferSharing sharedBuffer = readAtLeast(header.messageLength)) {
      ByteBuffer nioInputBuffer = sharedBuffer.getBuffer();
      Assert.assertTrue(nioInputBuffer.remaining() >= header.messageLength);
      getStats().incMessagesBeingReceived(true, header.messageLength);
      long startSer = getStats().startMsgDeserialization();
      try {
        byteBufferInputStream.setBuffer(nioInputBuffer);
        ReplyProcessor21.initMessageRPId();
        return (DistributionMessage) InternalDataSerializer.readDSFID(byteBufferInputStream);
      } catch (RuntimeException e) {
        throw e;
      } catch (IOException e) {
        throw e;
      } finally {
        getStats().endMsgDeserialization(startSer);
        getStats().decMessagesBeingReceived(header.messageLength);
        ioFilter.doneReadingDirectAck(nioInputBuffer);
      }
    }
  }
Block until you can read a message. Returns null if the message was a message chunk.

@return the message, or null if we only received a chunk of the message
geode-core/src/main/java/org/apache/geode/internal/tcp/MsgReader.java