Skip to content

Commit

Permalink
add api codec
Browse files Browse the repository at this point in the history
  • Loading branch information
xiemingxun committed Jul 15, 2023
1 parent 6e41b0e commit 424f7a6
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions codec.go
Original file line number Diff line number Diff line change
Expand Up @@ -412,6 +412,14 @@ func (c *Codec) BinaryFromNative(buf []byte, datum interface{}) ([]byte, error)
return newBuf, nil
}

func (c *Codec) BinaryFromNativeOutput(out io.Writer, datum interface{}) error {
err := c.binaryFromNativeOutput(out, datum)
if err != nil {
return err // if error, return original byte slice
}
return nil
}

// NativeFromBinary returns a native datum value from the binary encoded byte
// slice in accordance with the Avro schema supplied when creating the Codec. On
// success, it returns the decoded datum, a byte slice containing the remaining
Expand Down

0 comments on commit 424f7a6

Please sign in to comment.