Tao.PhysFs SDK Documentation

Fs.PHYSFS_read Method (IntPtr, IntPtr, UInt32, UInt32)

Read data from a PhysicsFS filehandle. Buffer memory is allocated for you.

[Visual Basic]
Overloads Public Shared Function PHYSFS_read( _
   ByVal handle As IntPtr, _
   ByRef buffer As IntPtr, _
   ByVal objSize As UInt32, _
   ByVal objCount As UInt32 _
) As Long
[C#]
public static long PHYSFS_read(
   IntPtr handle,
   out IntPtr buffer,
   uint objSize,
   uint objCount
);

Parameters

handle
handle returned from PHYSFS_openRead.
buffer
buffer where memory is stored. Memory is allocated for you.
objSize
size in bytes of objects being read from (handle).
objCount
number of (objSize) objects to read from (handle).

Return Value

number of objects read. PHYSFS_getLastError can shed light on the reason this might be less than (objCount), as can PHYSFS_eof. -1 if complete failure.

Remarks

The file must be opened for reading. Note that this allocates memory and points to it through the buffer. You must then free the memory by using Marshal.FreeHGlobal(buffer)

See Also

Fs Class | Tao.PhysFs Namespace | Fs.PHYSFS_read Overload List | PHYSFS_eof