本文整理匯總了Java中javax.imageio.stream.FileImageInputStream.readInt方法的典型用法代碼示例。如果您正苦於以下問題:Java FileImageInputStream.readInt方法的具體用法?Java FileImageInputStream.readInt怎麽用?Java FileImageInputStream.readInt使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類javax.imageio.stream.FileImageInputStream
的用法示例。
在下文中一共展示了FileImageInputStream.readInt方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: read
import javax.imageio.stream.FileImageInputStream; //導入方法依賴的package包/類
/**
* Reads the meta data from the file or input stream that has been set on
* the constructor.
*/
public void read() throws IOException {
if (file != null) {
iin = new FileImageInputStream(file);
}
try {
iin.seek(0);
// Determine file type
int magic = iin.readInt();
iin.seek(0);
if (magic == 0x49492a00) {
// Little-Endian TIFF File
// XXX - Implement Little-Endian TIFF File support
} else if (magic == 0x4d4d002a) {
// Big-Endian TIFF File
// XXX - Implement Big-Endian TIFF File support
} else if (magic == 0x52494646) {
// Little-Endian RIFF File
readRIFF(iin);
} else {
// JFIF File
readJFIF(iin);
}
} finally {
if (file != null) {
iin.close();
}
}
}