Microsoft SDK for Java

readBuffer

This method of the DirectSoundResource Class reads an amount of data from a resource into the given buffer.

Syntax

public void readBuffer(int sourceIndex, int destIndex, int size, DSResourceDesc resourceDesc, byte[] buffer, int maxbuf);

Parameters

sourceIndex Index into the resource, indicating the first byte of data to read.
destIndex Index into the buffer, indicating to first byte to receive the data to be read.
size Number of bytes of data to read.
resourceDesc The DSResourceDesc object that contains a description of the resource. The fields of this object must have been previously initialized by using loadWaveResource or loadWaveFile.
buffer Array variable that receives the data.
maxbuf Length of the buffer array. The method retrieves no more than this amount of data.

Remarks

If destIndex is non-zero and destIndex + size is greater than maxbuf, the method fills to the end of the buffer, then wraps back to the beginning of the buffer and continues to fill the buffer until the method reads the requested data or encounters the position specified by destIndex.

© 1999 Microsoft Corporation. All rights reserved. Terms of use.