ResolvingDecoder(Schema writer, Schema reader, Decoder in) throws IOException { this(resolve(writer, reader), in); }
ResolvingDecoder(Schema writer, Schema reader, Decoder in) throws IOException { this(resolve(writer, reader), in); }
public ResolvingDecoder(Schema writer, Schema reader, Decoder in) throws IOException { this(resolve(writer, reader), in); }
ResolvingDecoder(Schema writer, Schema reader, Decoder in) throws IOException { this(resolve(writer, reader), in); }
ResolvingDecoder(Schema writer, Schema reader, Decoder in) throws IOException { this(resolve(writer, reader), in); }
public ResolvingDecoder(Schema writer, Schema reader, Decoder in) throws IOException { this(resolve(writer, reader), in); }
/** * Creates a new instance of AvroGenericRecordResolvingSerializer with the specified * writer and reader. * * @param writer - the writer {@link Schema} used by {@link #serialize(GenericRecord)}. * @param reader - the reader {@link Schema} used by {@link #deserialize(byte[])}. * @throws IOException if the {@link ResolvingDecoder} failed to resolve the reader versus the writer. */ public AvroGenericRecordResolvingSerializer(Schema writer, Schema reader) throws IOException { this._writer = writer; this._reader = reader; this._resolver = ResolvingDecoder.resolve(writer, reader); }
@SuppressWarnings("unchecked") public D read(D reuse, Decoder in) throws IOException { if (resolver == null) { resolver = ResolvingDecoder.resolve(actual, expected); } ResolvingDecoder r = new ResolvingDecoder(resolver, in); D result = (D) read(reuse, expected, r); r.drain(); return result; }