Defile.read

A wrapper for PHYSFS_read.

Reads data from a file. Note that the file must have been opened with the OpenFor.Read flag set. See the documentation for PHYSFS_read for details.

  1. size_t read(ref ubyte[] buffer, size_t objSize, size_t objCount)
    struct Defile
    size_t
    read
    (
    ref ubyte[] buffer
    ,
    size_t objSize
    ,
    size_t objCount
    )
  2. size_t read(void* ptr, size_t objSize, size_t objCount)

Parameters

buffer
Type: ubyte[]

The byte buffer which will be used to store the data read from the file. If the buffer is null, it will be allocated. If it is too small to hold objSize * objCount bytes, it will be extended.

objSize
Type: size_t

The number of bytes to read at a time.

objCount
Type: size_t

The number of times to read objSize bytes.

Return Value

Type: size_t

The total number of bytes read. Note that this differs from PHYSFS_read, which returns the number of objects read.

Throws

DefileException if an error occurs.

Meta