We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e97f909 commit c5a75bcCopy full SHA for c5a75bc
lib/bson/encoder.ex
@@ -17,6 +17,12 @@ defmodule BSON.Encoder do
17
def encode(:BSON_max),
18
do: ""
19
20
+ def encode(%BSON.Binary{binary: binary, subtype: :binary_old}) do
21
+ subtype = subtype(:binary_old)
22
+ size = IO.iodata_length(binary)
23
+ [<<size + 4::int32>>, subtype, <<size::int32>>, binary]
24
+ end
25
+
26
def encode(%BSON.Binary{binary: binary, subtype: subtype}) do
27
subtype = subtype(subtype)
28
[<<IO.iodata_length(binary)::int32>>, subtype | binary]
0 commit comments