| synopsis || return value || arguments || prev || next |
Overload navigation: 1, 2, 3, 4, 5, 6
virtual int read( kdu_byte * buf, int num_bytes)
Java: int Read( byte[] buf, int num_bytes)
[Declared in "../apps/compressed_io/jp2.h"]
See kdu_compressed_source::read for an explanation. Note that when multiple jp2_input_box objects are opened using the same jp2_family_src object, they may be read in any order, so long as the underlying data source supports KDU_SOURCE_CAP_SEEKABLE or KDU_SOURCE_CAP_CACHED. However, arbitration between multiple boxes is not inherently thread safe, meaning that you should not access different boxes of a single jp2_family_src object from different threads, unless that object has been made thread safe by implementing its jp2_family_src::acquire_lock and jp2_family_src::release_lock functions.
May return a value smaller than num_bytes if the container (a super-box, or the underlying data source) is exhausted. When this happens, get_remaining_bytes will return 0.
May also return a value smaller than num_bytes if the underlying jp2_family_src object was opened using a kdu_cache data source, in which case the relevant cache entries may not yet be complete. In this case, subsequent calls to the function may be able to retrieve additional data once the cache has been augmented. This condition may be distinguished from that of a truly exhausted box by the fact that get_remaining_bytes will either return -1 (rubber length box) or a positive value (total box length is known to be larger than the number of bytes currently available).
| top || synopsis || return value || arguments || prev || next |