Package org.spf4j.avro.csv
Class CsvEncoder
- java.lang.Object
-
- org.apache.avro.io.Encoder
-
- org.spf4j.avro.csv.CsvEncoder
-
- All Implemented Interfaces:
Flushable,org.apache.avro.io.parsing.Parser.ActionHandler
public final class CsvEncoder extends org.apache.avro.io.Encoder implements org.apache.avro.io.parsing.Parser.ActionHandlerA Csv decoder for avro records.- Author:
- Zoltan Farkas
-
-
Constructor Summary
Constructors Constructor Description CsvEncoder(org.spf4j.io.csv.CsvWriter csvWriter, org.apache.avro.Schema writerSchema)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.apache.avro.io.parsing.SymboldoAction(org.apache.avro.io.parsing.Symbol symbol, org.apache.avro.io.parsing.Symbol symbol1)voidflush()voidsetItemCount(long l)voidstartItem()StringtoString()voidwriteArrayEnd()voidwriteArrayStart()voidwriteBoolean(boolean bln)voidwriteBytes(byte[] bytes, int i, int length)voidwriteBytes(ByteBuffer bb)voidwriteDouble(double d)voidwriteEnum(int e)voidwriteFixed(byte[] bytes, int i, int length)voidwriteFloat(float f)voidwriteHeader()voidwriteIndex(int unionIndex)voidwriteInt(int i)voidwriteLong(long l)voidwriteMapEnd()voidwriteMapStart()voidwriteNull()voidwriteString(org.apache.avro.util.Utf8 utf8)
-
-
-
Method Detail
-
writeHeader
public void writeHeader() throws IOException- Throws:
IOException
-
writeNull
public void writeNull() throws IOException- Specified by:
writeNullin classorg.apache.avro.io.Encoder- Throws:
IOException
-
writeBoolean
public void writeBoolean(boolean bln) throws IOException- Specified by:
writeBooleanin classorg.apache.avro.io.Encoder- Throws:
IOException
-
writeInt
public void writeInt(int i) throws IOException- Specified by:
writeIntin classorg.apache.avro.io.Encoder- Throws:
IOException
-
writeLong
public void writeLong(long l) throws IOException- Specified by:
writeLongin classorg.apache.avro.io.Encoder- Throws:
IOException
-
writeFloat
public void writeFloat(float f) throws IOException- Specified by:
writeFloatin classorg.apache.avro.io.Encoder- Throws:
IOException
-
writeDouble
public void writeDouble(double d) throws IOException- Specified by:
writeDoublein classorg.apache.avro.io.Encoder- Throws:
IOException
-
writeString
public void writeString(org.apache.avro.util.Utf8 utf8) throws IOException- Specified by:
writeStringin classorg.apache.avro.io.Encoder- Throws:
IOException
-
writeBytes
public void writeBytes(ByteBuffer bb) throws IOException
- Specified by:
writeBytesin classorg.apache.avro.io.Encoder- Throws:
IOException
-
writeBytes
public void writeBytes(byte[] bytes, int i, int length) throws IOException- Specified by:
writeBytesin classorg.apache.avro.io.Encoder- Throws:
IOException
-
writeFixed
public void writeFixed(byte[] bytes, int i, int length) throws IOException- Specified by:
writeFixedin classorg.apache.avro.io.Encoder- Throws:
IOException
-
writeEnum
public void writeEnum(int e) throws IOException- Specified by:
writeEnumin classorg.apache.avro.io.Encoder- Throws:
IOException
-
writeArrayStart
public void writeArrayStart() throws IOException- Specified by:
writeArrayStartin classorg.apache.avro.io.Encoder- Throws:
IOException
-
writeArrayEnd
public void writeArrayEnd() throws IOException- Specified by:
writeArrayEndin classorg.apache.avro.io.Encoder- Throws:
IOException
-
writeMapStart
public void writeMapStart()
- Specified by:
writeMapStartin classorg.apache.avro.io.Encoder
-
writeMapEnd
public void writeMapEnd()
- Specified by:
writeMapEndin classorg.apache.avro.io.Encoder
-
writeIndex
public void writeIndex(int unionIndex) throws IOException- Specified by:
writeIndexin classorg.apache.avro.io.Encoder- Throws:
IOException
-
flush
public void flush() throws IOException- Specified by:
flushin interfaceFlushable- Throws:
IOException
-
doAction
@Nullable public org.apache.avro.io.parsing.Symbol doAction(org.apache.avro.io.parsing.Symbol symbol, org.apache.avro.io.parsing.Symbol symbol1)
- Specified by:
doActionin interfaceorg.apache.avro.io.parsing.Parser.ActionHandler
-
setItemCount
public void setItemCount(long l)
- Specified by:
setItemCountin classorg.apache.avro.io.Encoder
-
startItem
public void startItem() throws IOException- Specified by:
startItemin classorg.apache.avro.io.Encoder- Throws:
IOException
-
-