lib/core: Bytes is now Writable
authorLucas Bajolet <r4pass@hotmail.com>
Thu, 24 Sep 2015 18:46:39 +0000 (14:46 -0400)
committerLucas Bajolet <r4pass@hotmail.com>
Thu, 24 Sep 2015 18:46:39 +0000 (14:46 -0400)
Signed-off-by: Lucas Bajolet <r4pass@hotmail.com>

lib/core/stream.nit

index b4a0e2b..e097f9b 100644 (file)
@@ -425,6 +425,13 @@ interface Writable
        end
 end
 
+redef class Bytes
+       super Writable
+       redef fun write_to(s) do s.write_bytes(self)
+
+       redef fun write_to_string do return to_s
+end
+
 redef class Text
        super Writable
        redef fun write_to(stream) do stream.write(self)