--
-$Id: ChangeLog 45 2005-05-25 20:08:35Z tilman $
+$Id: ChangeLog 46 2005-05-25 20:10:37Z tilman $
++
2005-05-25 Tilman Sauerbeck (tilman at code-monkey de)
consumed is now returned, too.
* lib/eet.rb: Stream.deserialize fails if the given buffer is
empty
+ * lib/eet.rb: Chunk.deserialize fails if the given buffer is
+ empty
2005-05-19 Tilman Sauerbeck (tilman at code-monkey de)
* Rakefile: Code cleanup
#--
-# $Id: eet.rb 45 2005-05-25 20:08:35Z tilman $
+# $Id: eet.rb 46 2005-05-25 20:10:37Z tilman $
#
# Copyright (c) 2005 Tilman Sauerbeck (tilman at code-monkey de)
#
end
def Chunk.deserialize(data)
+ if data.to_str.empty?
+ raise(ArgumentError, "buffer is empty")
+ end
+
if data.length < 8 || data[0, 4] != "CHnK"
raise(ChunkError, "invalid data")
end