/** Find the next position of fourcc or LIST fourcc, but does not read it, only * returns the first position inside the fourcc chunk and puts the file pointer * behind the fourcc chunk (if successful). * If not found, returns -1 */ private long findFourccAndSkip(int fourcc, boolean isList, long endPosition) throws IOException { while (true) { int type = readType(endPosition); if (type == 0) //reached endPosition without finding return -1; long size = readInt() & SIZE_MASK; long chunkPos = raFile.getFilePointer(); long nextPos = chunkPos + size; //note that 'size' of a list includes the 'type' that follows now if (isList && type == FOURCC_LIST) type = readInt(); if (verbose) IJ.log("Searching for (to skip) '"+fourccString(fourcc)+"', found "+fourccString(type)+ "' data "+posSizeString(chunkPos, size)); raFile.seek(nextPos); if (type == fourcc) return chunkPos; //found and skipped, breaks the loop } }
/** Find the next position of fourcc or LIST fourcc, but does not read it, only * returns the first position inside the fourcc chunk and puts the file pointer * behind the fourcc chunk (if successful). * If not found, returns -1 */ private long findFourccAndSkip(int fourcc, boolean isList, long endPosition) throws IOException { while (true) { int type = readType(endPosition); if (type == 0) //reached endPosition without finding return -1; long size = readInt() & SIZE_MASK; long chunkPos = raFile.getFilePointer(); long nextPos = chunkPos + size; //note that 'size' of a list includes the 'type' that follows now if (isList && type == FOURCC_LIST) type = readInt(); if (verbose) IJ.log("Searching for (to skip) '"+fourccString(fourcc)+"', found "+fourccString(type)+ "' data "+posSizeString(chunkPos, size)); raFile.seek(nextPos); if (type == fourcc) return chunkPos; //found and skipped, breaks the loop } }
boolean contentOk = false; do { int type = readType(endPosition); if (type == 0) { //reached endPosition without finding if (throwNotFoundException)
boolean contentOk = false; do { int type = readType(endPosition); if (type == 0) { //reached endPosition without finding if (throwNotFoundException)
stack = new ImageStack(dwWidth, biHeight); while (true) { //loop over all chunks int type = readType(endPosition); if (type==0) break; //endPosition of 'movi' reached? long size = readInt() & SIZE_MASK;
stack = new ImageStack(dwWidth, biHeight); while (true) { //loop over all chunks int type = readType(endPosition); if (type==0) break; //endPosition of 'movi' reached? long size = readInt() & SIZE_MASK;