Skip to content

Commit abde168

Browse files
authored
Minor fix to avoid extra trailing zeroes during serialization (#2521)
1 parent b282b2c commit abde168

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/Confluent.SchemaRegistry.Serdes.Avro/GenericSerializerImpl.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ public async Task<byte[]> Serialize(string topic, Headers headers, GenericRecord
182182
.Write(data, new BinaryEncoder(stream));
183183

184184
var buffer = await ExecuteRules(isKey, subject, topic, headers, RulePhase.Encoding, RuleMode.Write,
185-
null, latestSchema, stream.GetBuffer(), null)
185+
null, latestSchema, stream.ToArray(), null)
186186
.ContinueWith(t => (byte[])t.Result)
187187
.ConfigureAwait(continueOnCapturedContext: false);
188188

src/Confluent.SchemaRegistry.Serdes.Avro/SpecificSerializerImpl.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ public async Task<byte[]> Serialize(string topic, Headers headers, T data, bool
223223
currentSchemaData.AvroWriter.Write(data, new BinaryEncoder(stream));
224224

225225
var buffer = await ExecuteRules(isKey, subject, topic, headers, RulePhase.Encoding, RuleMode.Write,
226-
null, latestSchema, stream.GetBuffer(), null)
226+
null, latestSchema, stream.ToArray(), null)
227227
.ContinueWith(t => (byte[])t.Result)
228228
.ConfigureAwait(continueOnCapturedContext: false);
229229

0 commit comments

Comments
 (0)