Package com.landawn.abacus.parser
Class AvroParser
java.lang.Object
com.landawn.abacus.parser.AvroParser
- All Implemented Interfaces:
Parser<AvroSerializationConfig,
AvroDeserializationConfig>
The content is encoded with Base64 if the target output is String or Writer, otherwise the content is NOT encoded with Base64 if the target output is File or OutputStream.
So content must be encoded with Base64 if the specified input is String or Reader, otherwise the content must NOT be encoded with Base64 if the specified input is File or InputStream.
The reason not to encoded the content with Base64 for File/OutputStream is to provide higher performance solution.
- Since:
- 0.8
- Author:
- Haiyang Li
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescription<T> T
deserialize
(Class<T> targetClass, File file) <T> T
deserialize
(Class<T> targetClass, File file, AvroDeserializationConfig config) <T> T
deserialize
(Class<T> targetClass, InputStream is) <T> T
deserialize
(Class<T> targetClass, InputStream is, AvroDeserializationConfig config) <T> T
deserialize
(Class<T> targetClass, Reader reader) <T> T
deserialize
(Class<T> targetClass, Reader reader, AvroDeserializationConfig config) <T> T
deserialize
(Class<T> targetClass, String st) <T> T
deserialize
(Class<T> targetClass, String st, AvroDeserializationConfig config) void
void
serialize
(File file, Object obj, AvroSerializationConfig config) void
serialize
(OutputStream os, Object obj) void
serialize
(OutputStream os, Object obj, AvroSerializationConfig config) void
void
serialize
(Writer writer, Object obj, AvroSerializationConfig config) serialize
(Object obj, AvroSerializationConfig config)
-
Constructor Details
-
AvroParser
public AvroParser()
-
-
Method Details
-
serialize
- Parameters:
obj
-config
-- Returns:
-
serialize
- Parameters:
file
-obj
-config
-
-
serialize
- Parameters:
os
-obj
-config
-
-
serialize
public void serialize(Writer writer, Object obj, AvroSerializationConfig config) throws UnsupportedOperationException - Parameters:
writer
-obj
-config
-- Throws:
UnsupportedOperationException
-
deserialize
- Type Parameters:
T
-- Parameters:
targetClass
-st
-config
-- Returns:
-
deserialize
- Type Parameters:
T
-- Parameters:
targetClass
-file
-config
-- Returns:
-
deserialize
- Type Parameters:
T
-- Parameters:
targetClass
-is
-config
-- Returns:
-
deserialize
public <T> T deserialize(Class<T> targetClass, Reader reader, AvroDeserializationConfig config) throws UnsupportedOperationException - Type Parameters:
T
-- Parameters:
targetClass
-reader
-config
-- Returns:
- Throws:
UnsupportedOperationException
-
serialize
- Specified by:
serialize
in interfaceParser<SC extends SerializationConfig<?>,
DC extends DeserializationConfig<?>> - Parameters:
obj
-- Returns:
-
serialize
- Specified by:
serialize
in interfaceParser<SC extends SerializationConfig<?>,
DC extends DeserializationConfig<?>> - Parameters:
file
-obj
-
-
serialize
- Specified by:
serialize
in interfaceParser<SC extends SerializationConfig<?>,
DC extends DeserializationConfig<?>> - Parameters:
os
-obj
-
-
serialize
- Specified by:
serialize
in interfaceParser<SC extends SerializationConfig<?>,
DC extends DeserializationConfig<?>> - Parameters:
writer
-obj
-
-
deserialize
- Specified by:
deserialize
in interfaceParser<SC extends SerializationConfig<?>,
DC extends DeserializationConfig<?>> - Type Parameters:
T
-- Parameters:
targetClass
-st
-- Returns:
-
deserialize
- Specified by:
deserialize
in interfaceParser<SC extends SerializationConfig<?>,
DC extends DeserializationConfig<?>> - Type Parameters:
T
-- Parameters:
targetClass
-file
-- Returns:
-
deserialize
- Specified by:
deserialize
in interfaceParser<SC extends SerializationConfig<?>,
DC extends DeserializationConfig<?>> - Type Parameters:
T
-- Parameters:
targetClass
-is
-- Returns:
-
deserialize
- Specified by:
deserialize
in interfaceParser<SC extends SerializationConfig<?>,
DC extends DeserializationConfig<?>> - Type Parameters:
T
-- Parameters:
targetClass
-reader
-- Returns:
-