Code example for RandomAccessFile

Methods: length, seek, skipBytes

0
			int nIndex, int data[]) {
		int ret = 0;
		try { 
			if (offset == 0) {
				int pos = 0;
				file.seek(file.length() - 4);
				pos = readIntLittleEndian(file);
				file.seek(file.length() - pos);
 
			} else { 
				file.seek(offset);
			} 
			int buffer[] = new int[2];
			buffer[0] = readIntLittleEndian(file);
			buffer[1] = readIntLittleEndian(file);
			if ((foucc == 0 || foucc == buffer[0])
					&& (nIndex > 0 && nIndex < buffer[1])) {
				file.skipBytes((nIndex - 1) * 4);
				buffer[0] = readIntLittleEndian(file);
				buffer[1] = readIntLittleEndian(file);
				ret = buffer[0];
				data[0] = buffer[0];
				data[1] = buffer[1];