You can use rawRead: http://dlang.org/phobos/std_stdio.html#.File.rawRead
for that i need to know the size of the contents. is there a function that does that for me? i'm looking for something like someFile.readAll(). and it shouldn't matter whether the File instance represents a regular file or a pipe/stream.