org.apache.avro.protobuf
Class ProtobufDatumWriter<T>

java.lang.Object
  extended by org.apache.avro.generic.GenericDatumWriter<T>
      extended by org.apache.avro.protobuf.ProtobufDatumWriter<T>
All Implemented Interfaces:
DatumWriter<T>

public class ProtobufDatumWriter<T>
extends GenericDatumWriter<T>

DatumWriter for generated protobuf classes.


Constructor Summary
  ProtobufDatumWriter()
           
  ProtobufDatumWriter(Class<T> c)
           
protected ProtobufDatumWriter(ProtobufData protobufData)
           
  ProtobufDatumWriter(Schema schema)
           
protected ProtobufDatumWriter(Schema root, ProtobufData protobufData)
           
 
Method Summary
protected  void writeBytes(Object datum, Encoder out)
          Called to write a bytes.
protected  void writeEnum(Schema schema, Object datum, Encoder out)
          Called to write an enum value.
 
Methods inherited from class org.apache.avro.generic.GenericDatumWriter
getArrayElements, getArraySize, getData, getMapEntries, getMapSize, npe, resolveUnion, setSchema, write, write, writeArray, writeFixed, writeMap, writeRecord, writeString, writeString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ProtobufDatumWriter

public ProtobufDatumWriter()

ProtobufDatumWriter

public ProtobufDatumWriter(Class<T> c)

ProtobufDatumWriter

public ProtobufDatumWriter(Schema schema)

ProtobufDatumWriter

protected ProtobufDatumWriter(Schema root,
                              ProtobufData protobufData)

ProtobufDatumWriter

protected ProtobufDatumWriter(ProtobufData protobufData)
Method Detail

writeEnum

protected void writeEnum(Schema schema,
                         Object datum,
                         Encoder out)
                  throws IOException
Description copied from class: GenericDatumWriter
Called to write an enum value. May be overridden for alternate enum representations.

Overrides:
writeEnum in class GenericDatumWriter<T>
Throws:
IOException

writeBytes

protected void writeBytes(Object datum,
                          Encoder out)
                   throws IOException
Description copied from class: GenericDatumWriter
Called to write a bytes. May be overridden for alternate bytes representations.

Overrides:
writeBytes in class GenericDatumWriter<T>
Throws:
IOException


Copyright © 2009-2011 The Apache Software Foundation. All Rights Reserved.