From 6e0ef1aae038ceb239785a2a17a466eb03477f6f Mon Sep 17 00:00:00 2001 From: forbjok Date: Sat, 10 Dec 2016 18:45:43 +0100 Subject: [PATCH] Fix dumping to file producing garbage (#3) * Fix dumping to file producing garbage * Use rawWrite instead of casting to char[] --- source/dyaml/stream.d | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/dyaml/stream.d b/source/dyaml/stream.d index 01fd4af..b8cf4a0 100644 --- a/source/dyaml/stream.d +++ b/source/dyaml/stream.d @@ -58,11 +58,11 @@ class YFile : YStream { } void writeExact(const void* buffer, size_t size) { - this.file.write(cast(const ubyte[])buffer[0 .. size]); + this.file.rawWrite(cast(const) buffer[0 .. size]); } size_t write(const(ubyte)[] buffer) { - this.file.write(buffer); + this.file.rawWrite(buffer); return buffer.length; }