Package org.apache.avro.io
Class ByteBufferToHexFormatJsonEncoder
java.lang.Object
org.apache.avro.io.Encoder
org.apache.avro.io.ParsingEncoder
org.apache.avro.io.JsonEncoder
org.apache.avro.io.ByteBufferToHexFormatJsonEncoder
- All Implemented Interfaces:
Flushable,org.apache.avro.io.parsing.Parser.ActionHandler
public class ByteBufferToHexFormatJsonEncoder
extends org.apache.avro.io.JsonEncoder
This class overrides
JsonEncoder.writeBytes(byte[], int, int), in order to convert
all bytes schema data to hexadecimal strings in the output stream, since hexadecimal strings
are more readable.
This should be used in tooling only.-
Field Summary
Fields inherited from class org.apache.avro.io.JsonEncoder
isEmptyFields inherited from class org.apache.avro.io.ParsingEncoder
pos -
Constructor Summary
ConstructorsConstructorDescriptionByteBufferToHexFormatJsonEncoder(org.apache.avro.Schema sc, OutputStream out) -
Method Summary
Modifier and TypeMethodDescriptionvoidwriteBytes(byte[] bytes, int start, int len) voidwriteFixed(byte[] bytes, int start, int len) voidwriteString(String str) Detect whether there is any non-ASCII character; if so, transfer the entire string into hexadecimal string.Methods inherited from class org.apache.avro.io.JsonEncoder
configure, doAction, flush, isIncludeNamespace, setIncludeNamespace, startItem, writeArrayEnd, writeArrayStart, writeBoolean, writeBytes, writeDouble, writeEnum, writeFloat, writeIndex, writeInt, writeLong, writeMapEnd, writeMapStart, writeNull, writeStringMethods inherited from class org.apache.avro.io.ParsingEncoder
depth, pop, push, setItemCountMethods inherited from class org.apache.avro.io.Encoder
writeBytes, writeFixed, writeFixed, writeString
-
Constructor Details
-
ByteBufferToHexFormatJsonEncoder
public ByteBufferToHexFormatJsonEncoder(org.apache.avro.Schema sc, OutputStream out) throws IOException - Throws:
IOException
-
-
Method Details
-
writeBytes
- Overrides:
writeBytesin classorg.apache.avro.io.JsonEncoder- Throws:
IOException
-
writeFixed
- Overrides:
writeFixedin classorg.apache.avro.io.JsonEncoder- Throws:
IOException
-
writeString
Detect whether there is any non-ASCII character; if so, transfer the entire string into hexadecimal string.- Overrides:
writeStringin classorg.apache.avro.io.JsonEncoder- Throws:
IOException
-