com.twitter.elephantbird.cascading2.io.protobuf
Class ProtobufReflectionUtil

java.lang.Object
  extended by com.twitter.elephantbird.cascading2.io.protobuf.ProtobufReflectionUtil

public final class ProtobufReflectionUtil
extends Object

Utility methods for reflection based protobuf deserialization

Author:
Ning Liang

Method Summary
static com.google.protobuf.Message parseMessage(Class<com.google.protobuf.Message> klass, InputStream in)
          Parse the message in a given Message container
static com.google.protobuf.Message parseMessage(Method parseMethod, InputStream in)
          Parse the message in a given InputStream using scpecified Method
static Method parseMethodFor(Class<com.google.protobuf.Message> klass)
          Parse the method for a message
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

parseMethodFor

public static Method parseMethodFor(Class<com.google.protobuf.Message> klass)
Parse the method for a message

Parameters:
klass - the class containing the message
Returns:
the parsed method

parseMessage

public static com.google.protobuf.Message parseMessage(Method parseMethod,
                                                       InputStream in)
Parse the message in a given InputStream using scpecified Method

Parameters:
parseMethod - the method used for parsing
in - the input stream
Returns:
the parsed message

parseMessage

public static com.google.protobuf.Message parseMessage(Class<com.google.protobuf.Message> klass,
                                                       InputStream in)
Parse the message in a given Message container

Parameters:
klass - the class containing the message
in - the input stream
Returns:
the parsed Message


Copyright © 2015 Twitter. All Rights Reserved.