/** * Creates a new {@link BinaryMessageEncoder} that uses the given * {@link GenericData data model} to deconstruct datum instances described by * the {@link Schema schema}. * <p> * If {@code shouldCopy} is true, then buffers returned by {@link #encode(D)} * are copied and will not be modified by future calls to {@code encode}. * <p> * If {@code shouldCopy} is false, then buffers returned by {@code encode} * wrap a thread-local buffer that can be reused by future calls to * {@code encode}, but may not be. Callers should only set {@code shouldCopy} * to false if the buffer will be copied before the current thread's next call * to {@code encode}. * * @param model the {@link GenericData data model} for datum instances * @param schema the {@link Schema} for datum instances * @param shouldCopy whether to copy buffers before returning encoded results */ public BinaryMessageEncoder(GenericData model, Schema schema, boolean shouldCopy) { this.writeCodec = new V1MessageEncoder<D>(model, schema, shouldCopy); }
V1MessageEncoder(GenericData model, Schema schema, boolean shouldCopy) { super(model, schema, shouldCopy); this.headerBytes = getWriteHeader(schema); }
/** * Creates a new {@link BinaryMessageEncoder} that uses the given * {@link GenericData data model} to deconstruct datum instances described by * the {@link Schema schema}. * <p> * If {@code shouldCopy} is true, then buffers returned by {@link #encode(D)} * are copied and will not be modified by future calls to {@code encode}. * <p> * If {@code shouldCopy} is false, then buffers returned by {@code encode} * wrap a thread-local buffer that can be reused by future calls to * {@code encode}, but may not be. Callers should only set {@code shouldCopy} * to false if the buffer will be copied before the current thread's next call * to {@code encode}. * * @param model the {@link GenericData data model} for datum instances * @param schema the {@link Schema} for datum instances * @param shouldCopy whether to copy buffers before returning encoded results */ public BinaryMessageEncoder(GenericData model, Schema schema, boolean shouldCopy) { this.writeCodec = new V1MessageEncoder<D>(model, schema, shouldCopy); }
/** * Creates a new {@link BinaryMessageEncoder} that uses the given * {@link GenericData data model} to deconstruct datum instances described by * the {@link Schema schema}. * <p> * If {@code shouldCopy} is true, then buffers returned by {@link #encode(D)} * are copied and will not be modified by future calls to {@code encode}. * <p> * If {@code shouldCopy} is false, then buffers returned by {@code encode} * wrap a thread-local buffer that can be reused by future calls to * {@code encode}, but may not be. Callers should only set {@code shouldCopy} * to false if the buffer will be copied before the current thread's next call * to {@code encode}. * * @param model the {@link GenericData data model} for datum instances * @param schema the {@link Schema} for datum instances * @param shouldCopy whether to copy buffers before returning encoded results */ public BinaryMessageEncoder(GenericData model, Schema schema, boolean shouldCopy) { this.writeCodec = new V1MessageEncoder<>(model, schema, shouldCopy); }
V1MessageEncoder(GenericData model, Schema schema, boolean shouldCopy) { super(model, schema, shouldCopy); this.headerBytes = getWriteHeader(schema); }
V1MessageEncoder(GenericData model, Schema schema, boolean shouldCopy) { super(model, schema, shouldCopy); this.headerBytes = getWriteHeader(schema); }