readFile

Read a whole file into a buffer.

If the supplied buffer is large enough, it will be used to store the contents of the file. Otherwise, a new buffer will be allocated.

  1. ubyte[] readFile(NativePath path, ubyte[] buffer, size_t max_size)
  2. ubyte[] readFile(string path, ubyte[] buffer, size_t max_size)
    @safe
    ubyte[]
    readFile
    (
    string path
    ,
    ubyte[] buffer = null
    ,
    size_t max_size = size_t.max
    )

Parameters

path string

The path of the file to read

buffer ubyte[]

An optional buffer to use for storing the file contents

Meta