| synopsis || return value || arguments || prev || next |

kdu_compressed_source::read

Java: Kdu_compressed_source::Read

virtual int read( kdu_byte * buf, int num_bytes)

Java: int Read( byte[] buf, int num_bytes)

[Declared in "../coresys/common/kdu_compressed.h"]

Go to class description.


Synopsis

This function must be implemented in every derived class. It performs a sequential read operation, within the current read scope, transferring the next num_bytes bytes from the scope into the supplied buffer. The function must return the actual number of bytes recovered, which will be less than num_bytes only if the read scope is exhausted.

The default read scope is the entire code-stream, although the source may support tile header and precinct scopes (see set_tileheader_scope and set_precinct_scope functions below).

The system provides its own internal temporary buffering of compressed data to maximize internal access efficiency. For this reason, the virtual read function defined here will usually be called to transfer quite a few bytes at a time.


Return Value

Actual number of bytes written into the buffer.

Arguments

buf [kdu_byte *]

Pointer to a buffer large enough to accept the requested bytes.

num_bytes [int]

Number of bytes to be read, unless the read scope is exhausted first.


| top || synopsis || return value || arguments || prev || next |