private void readRoot() throws IOException {
        if (root != null) {
            return;
        }
        final ByteArrayOutputStream content = new ByteArrayOutputStream();
        try (TemporaryThreadLocals tempThreadLocals = TemporaryThreadLocals.acquire()) {
            final byte[] buffer = tempThreadLocals.byteArray(READ_BUFFER_SIZE);
            try {
                while (trans_.read(buffer, 0, READ_BUFFER_SIZE) > 0) {
                    content.write(buffer);
                }
            } catch (TTransportException e) {
                if (TTransportException.END_OF_FILE != e.getType()) {
                    throw new IOException(e);
                }
            }
            root = OBJECT_MAPPER.readTree(content.toByteArray());
        }
    }
Read in the root node if it has not yet been read.
thrift/thrift0.13/src/main/java/com/linecorp/armeria/common/thrift/text/TTextProtocol.java