lib/chunky_png/datastream.rb in chunky_png-0.10.3 vs lib/chunky_png/datastream.rb in chunky_png-0.10.4
- old
+ new
@@ -144,9 +144,15 @@
##################################################################################
# WRITING DATASTREAMS
##################################################################################
+ # Returns an empty stream using binary encoding that can be used as stream to encode to.
+ # @eturn [String] An empty, binary string.
+ def self.empty_bytearray
+ ChunkyPNG::EMPTY_BYTEARRAY.dup
+ end
+
# Writes the datastream to the given output stream.
# @param [IO] io The output stream to write to.
def write(io)
io << SIGNATURE
each_chunk { |c| c.write(io) }