下面列出了javax.imageio.stream.ImageInputStream#readInt ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。
public PNGImageDataEnumeration(ImageInputStream stream)
throws IOException {
this.stream = stream;
this.length = stream.readInt();
int type = stream.readInt(); // skip chunk type
}
public PNGImageDataEnumeration(ImageInputStream stream)
throws IOException {
this.stream = stream;
this.length = stream.readInt();
int type = stream.readInt(); // skip chunk type
}
/** Reads a box from the <code>ImageInputStream</code. at the provided
* position.
*/
public void read(ImageInputStream iis, int pos) throws IOException {
iis.mark();
iis.seek(pos);
length = iis.readInt();
type = iis.readInt();
int dataLength = 0;
if(length == 0) {
// Length unknown at time of stream creation.
long streamLength = iis.length();
if(streamLength != -1)
// Calculate box length from known stream length.
dataLength = (int)(streamLength - iis.getStreamPosition());
else {
// Calculate box length by reading to EOF.
long dataPos = iis.getStreamPosition();
int bufLen = 1024;
byte[] buf = new byte[bufLen];
long savePos = dataPos;
try {
iis.readFully(buf);
dataLength += bufLen;
savePos = iis.getStreamPosition();
} catch(EOFException eofe) {
iis.seek(savePos);
while(iis.read() != -1) dataLength++;
}
iis.seek(dataPos);
}
} else if(length == 1) {
// Length given by XL parameter.
extraLength = iis.readLong();
dataLength = (int)(extraLength - 16);
} else if(length >= 8 && length < (1 << 32)) {
// Length given by L parameter.
dataLength = length - 8;
} else {
// Illegal value for L parameter.
throw new IIOException("Illegal value "+length+
" for box length parameter.");
}
data = new byte[dataLength];
iis.readFully(data);
iis.reset();
}
public PNGImageDataEnumeration(ImageInputStream stream)
throws IOException {
this.stream = stream;
this.length = stream.readInt();
int type = stream.readInt(); // skip chunk type
}
public PNGImageDataEnumeration(ImageInputStream stream)
throws IOException {
this.stream = stream;
this.length = stream.readInt();
int type = stream.readInt(); // skip chunk type
}
public PNGImageDataEnumeration(ImageInputStream stream)
throws IOException {
this.stream = stream;
this.length = stream.readInt();
int type = stream.readInt(); // skip chunk type
}
public PNGImageDataEnumeration(ImageInputStream stream)
throws IOException {
this.stream = stream;
this.length = stream.readInt();
int type = stream.readInt(); // skip chunk type
}
public PNGImageDataEnumeration(ImageInputStream stream)
throws IOException {
this.stream = stream;
this.length = stream.readInt();
int type = stream.readInt(); // skip chunk type
}
public PNGImageDataEnumeration(ImageInputStream stream)
throws IOException {
this.stream = stream;
this.length = stream.readInt();
int type = stream.readInt(); // skip chunk type
}
public PNGImageDataEnumeration(ImageInputStream stream)
throws IOException {
this.stream = stream;
this.length = stream.readInt();
int type = stream.readInt(); // skip chunk type
}
public PNGImageDataEnumeration(ImageInputStream stream)
throws IOException {
this.stream = stream;
this.length = stream.readInt();
int type = stream.readInt(); // skip chunk type
}
public PNGImageDataEnumeration(ImageInputStream stream)
throws IOException {
this.stream = stream;
this.length = stream.readInt();
int type = stream.readInt(); // skip chunk type
}
public PNGImageDataEnumeration(ImageInputStream stream)
throws IOException {
this.stream = stream;
this.length = stream.readInt();
int type = stream.readInt(); // skip chunk type
}
public PNGImageDataEnumeration(ImageInputStream stream)
throws IOException {
this.stream = stream;
this.length = stream.readInt();
int type = stream.readInt(); // skip chunk type
}
public PNGImageDataEnumeration(ImageInputStream stream)
throws IOException {
this.stream = stream;
this.length = stream.readInt();
int type = stream.readInt(); // skip chunk type
}
public PNGImageDataEnumeration(ImageInputStream stream)
throws IOException {
this.stream = stream;
this.length = stream.readInt();
int type = stream.readInt(); // skip chunk type
}
public PNGImageDataEnumeration(ImageInputStream stream)
throws IOException {
this.stream = stream;
this.length = stream.readInt();
int type = stream.readInt(); // skip chunk type
}