lib/logstash/outputs/bson/logstash_timestamp.rb in logstash-output-mongodb-3.1.5 vs lib/logstash/outputs/bson/logstash_timestamp.rb in logstash-output-mongodb-3.1.6
- old
+ new
@@ -23,11 +23,11 @@
module LogStashTimestamp
# A time is type 0x09 in the BSON spec.
BSON_TYPE = 9.chr.force_encoding(BINARY).freeze
- def to_bson(encoded = ''.force_encoding(BINARY))
- time.to_bson(encoded)
+ def to_bson(buffer = ByteBuffer.new)
+ time.to_bson(buffer)
end
module ClassMethods
# Deserialize UTC time from BSON.
# @param [ BSON ] bson encoded time.