Package io.fathom.cloud.protobuf

Source Code of io.fathom.cloud.protobuf.ProtobufJsonReader

package io.fathom.cloud.protobuf;

import io.fathom.cloud.protobuf.mapper.MessageMapper;

import java.io.IOException;

import com.google.gson.stream.JsonReader;
import com.google.protobuf.Descriptors.Descriptor;
import com.google.protobuf.Message;

public class ProtobufJsonReader {

    public static void deserialize(Message.Builder dest, JsonReader json) throws IOException {
        Descriptor descriptor = dest.getDescriptorForType();
        MessageMapper mapper = MessageMapper.getMessageMapper(descriptor);
        mapper.read(dest, json);
    }

}
TOP

Related Classes of io.fathom.cloud.protobuf.ProtobufJsonReader

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.