private HttpData encodeSuccess(ServiceRequestContext ctx, RpcResponse reply,
                                   SerializationFormat serializationFormat, String methodName, int seqId,
                                   TBase<?, ?> result) {

        final ByteBuf buf = ctx.alloc().buffer(128);
        boolean success = false;
        try {
            final TTransport transport = new TByteBufTransport(buf);
            final TProtocolFactory protocolFactory = responseProtocolFactories.get(serializationFormat);
            assert protocolFactory != null;
            final TProtocol outProto = protocolFactory.getProtocol(transport);
            final TMessage header = new TMessage(methodName, TMessageType.REPLY, seqId);
            outProto.writeMessageBegin(header);
            result.write(outProto);
            outProto.writeMessageEnd();

            ctx.logBuilder().responseContent(reply, new ThriftReply(header, result));

            final HttpData encoded = HttpData.wrap(buf);
            success = true;
            return encoded;
        } catch (TException e) {
            throw new Error(e); // Should never reach here.
        } finally {
            if (!success) {
                buf.release();
            }
        }
    }
Returns the default {@link SerializationFormat} of this service.
thrift/thrift0.13/src/main/java/com/linecorp/armeria/server/thrift/THttpService.java