public abstract class ImageInputStreamImpl extends Object implements ImageInputStream
ImageInputStream
。这个类的设计是为了减少必须由子类来实现的方法的数量。
特别是,这个类处理大多数或所有的字节顺序解释的细节,缓冲,标记/复位,丢弃,关闭和处理。
Modifier and Type | Field and Description |
---|---|
protected int |
bitOffset
流中的当前位偏移量。
|
protected ByteOrder |
byteOrder
流的字节顺序的枚举类
java.nio.ByteOrder 实例,在
ByteOrder.BIG_ENDIAN 表明网络字节顺序和
ByteOrder.LITTLE_ENDIAN 表示相反的顺序。
|
protected long |
flushedPos
在此之前的数据可能被丢弃的位置。
|
protected long |
streamPos
流中的当前读取位置。
|
Constructor and Description |
---|
ImageInputStreamImpl()
构建了一个
ImageInputStreamImpl 。
|
Modifier and Type | Method and Description |
---|---|
protected void |
checkClosed()
如果抛出一个
IOException 流已经关闭。
|
void |
close()
关闭流。
|
protected void |
finalize()
完成这个对象的垃圾收集之前。
|
void |
flush()
弃流的初始位置到当前流的位置之前。
|
void |
flushBefore(long pos)
其流的初始部分所指示的位置之前。
|
int |
getBitOffset()
返回当前位偏移量,作为一个介于0和7之间的整数,包括。
|
ByteOrder |
getByteOrder()
返回的字节顺序的数据值将被读取该流的
java.nio.ByteOrder 枚举实例。
|
long |
getFlushedPosition()
返回在流中寻找可能执行的最早的位置。
|
long |
getStreamPosition()
返回流的当前字节位置。
|
boolean |
isCached()
默认实现返回错误。
|
boolean |
isCachedFile()
默认实现返回错误。
|
boolean |
isCachedMemory()
默认实现返回错误。
|
long |
length()
返回
-1L 表明流具有未知的长度。
|
void |
mark()
将当前流位置推到标记位置上的堆栈上。
|
abstract int |
read()
从流中读取一个字节并返回0和255之间的
int 。
|
int |
read(byte[] b)
一个方便的方法,称
read(b, 0, b.length) 。
|
abstract int |
read(byte[] b, int off, int len)
从流中读取到
len 字节,并将它们存储到
b 从指数
off 。
|
int |
readBit()
从流中读取一个点并将其作为与价值
0 或
1 一
int 。
|
long |
readBits(int numBits)
从流中读取一个位串并将其作为
long ,与第一位读成为输出最重要的位。
|
boolean |
readBoolean()
从流中读取一个字节,如果是非零返回一个
true
boolean 价值,
false 如果是零。
|
byte |
readByte()
从流中读取一个字节,并将其作为
byte 价值。
|
void |
readBytes(IIOByteBuffer buf, int len)
读到
len 字节流,并对所提供的
IIOByteBuffer 表示字节数组,偏移,和长度的数据可以发现。
|
char |
readChar()
相当于
readUnsignedShort ,除了返回的结果是使用
char 数据类型。
|
double |
readDouble()
从流读取8字节,和(概念)将根据当前的字节顺序和作为一个
double 返回结果。
|
float |
readFloat()
从流读取4字节,和(概念)将根据当前的字节顺序和作为一个
float 返回结果。
|
void |
readFully(byte[] b)
读
b.length 字节流,并将它们存储到
b 从指数
0 。
|
void |
readFully(byte[] b, int off, int len)
读
len 字节流,并将它们存储到
b 从指数
off 。
|
void |
readFully(char[] c, int off, int len)
读
len 字符(16位无符号整数)从流根据当前字节顺序,并将它们存储到
c 从指数
off 。
|
void |
readFully(double[] d, int off, int len)
读
len 双打(64位IEEE双精度浮点数)从流根据当前字节顺序,并将它们存储到
d 从指数
off 。
|
void |
readFully(float[] f, int off, int len)
读
len 花车(32位IEEE单精度浮)从流根据当前字节顺序,并将它们存储到
f 从指数
off 。
|
void |
readFully(int[] i, int off, int len)
读
len 整型(签署从流32位整数)根据当前的字节顺序,并将它们存储到
i 从指数
off 。
|
void |
readFully(long[] l, int off, int len)
读
len 多头(符号的64位整数)从流根据当前字节顺序,并将它们存储到
l 从指数
off 。
|
void |
readFully(short[] s, int off, int len)
读
len 短裤(有符号的16位整数)从流根据当前字节顺序,并将它们存储到
s 从指数
off 。
|
int |
readInt()
从流读取4字节,和(概念)将根据当前的字节顺序和作为一个
int 返回结果。
|
String |
readLine()
从输入流读取下一行文本。
|
long |
readLong()
从流读取8字节,和(概念)将根据当前的字节顺序和作为一个
long 返回结果。
|
short |
readShort()
从流中读取两个字节,和(概念)将根据当前的字节顺序,和作为一个
short 值返回结果。
|
int |
readUnsignedByte()
从流中读取一个字节,和(概念)将其转换为int,面具与
0xff 为了脱掉任何符号扩展位,并将其作为
byte 价值。
|
long |
readUnsignedInt()
从流读取4字节,和(概念)将根据当前的字节顺序,把结果转换为长,这与
0xffffffffL 为了脱掉任何符号扩展位面具作为一个符号
long 值返回结果。
|
int |
readUnsignedShort()
从流中读取两个字节,和(概念)将根据当前的字节顺序,将得到的值的
int ,面具与
0xffff 为了脱掉任何符号扩展,但是,作为一个符号
int 值返回结果。
|
String |
readUTF()
读取一个字符串,一直采用
modified UTF-8编码格式。
|
void |
reset()
重置当前流的字节和比特位置从标记位置的堆栈。
|
void |
seek(long pos)
将当前流位置设置为所需的位置。
|
void |
setBitOffset(int bitOffset)
将位偏移量设置为7和0之间的整数,包括。
|
void |
setByteOrder(ByteOrder byteOrder)
为未来从该流读取数据值设置所需的字节顺序。
|
int |
skipBytes(int n)
当前流位置提升呼叫
seek(getStreamPosition() + n) 。
|
long |
skipBytes(long n)
当前流位置提升呼叫
seek(getStreamPosition() + n) 。
|
protected ByteOrder byteOrder
java.nio.ByteOrder
实例,在
ByteOrder.BIG_ENDIAN
表明网络字节顺序和
ByteOrder.LITTLE_ENDIAN
表示相反的顺序。默认情况下,该值是
ByteOrder.BIG_ENDIAN
。
protected long streamPos
protected int bitOffset
protected long flushedPos
flushedPos
永远> = 0。
protected final void checkClosed() throws IOException
IOException
流已经关闭。子类可以调用这个方法,从他们的任何方法,需要的流不被关闭。
IOException
如果流关闭。
public void setByteOrder(ByteOrder byteOrder)
ImageInputStream
枚举类java.nio.ByteOrder
用于指定的字节顺序。一个价值ByteOrder.BIG_ENDIAN
指定所谓的大端或网络字节顺序,即高字节优先。该格式的摩托罗拉和SPARC处理器存储数据,而英特尔处理器的数据存储在反向ByteOrder.LITTLE_ENDIAN
秩序。
字节顺序对结果没有影响的readBits
方法返回(或价值由ImageOutputStream.writeBits
)。
setByteOrder
接口
ImageInputStream
byteOrder
-一个
ByteOrder.BIG_ENDIAN
或
java.nio.ByteOrder.LITTLE_ENDIAN
,指示网络字节顺序或反向将用于未来的阅读。
ByteOrder
,
ImageInputStream.getByteOrder()
,
ImageInputStream.readBits(int)
public ByteOrder getByteOrder()
ImageInputStream
java.nio.ByteOrder
枚举实例。
getByteOrder
接口
ImageInputStream
ByteOrder.BIG_ENDIAN
或
ByteOrder.LITTLE_ENDIAN
,说明其中的字节顺序是。
ByteOrder
,
ImageInputStream.setByteOrder(java.nio.ByteOrder)
public abstract int read() throws IOException
int
。如果达到
-1
返回EOF。
子类必须为这种方法提供一个实现。子类实现应在退出之前更新流位置。
在流中的位偏移量必须在读取发生之前重置为零。
read
接口
ImageInputStream
-1
EOF。
IOException
如果流已关闭。
public int read(byte[] b) throws IOException
read(b, 0, b.length)
。
在流中的位偏移量在读取发生之前重置为零。
read
接口
ImageInputStream
b
-字节被写入到数组。
-1
指示EOF。
null
b
NullPointerException
。
IOException
如果I/O错误发生。
public abstract int read(byte[] b, int off, int len) throws IOException
len
字节流,并将它们存储到
b
从指数
off
。如果没有字节可以读取因为已到达流的末尾,则返回
-1
。
在流中的位偏移量必须在读取发生之前重置为零。
子类必须为这种方法提供一个实现。子类实现应在退出之前更新流位置。
read
接口
ImageInputStream
b
-字节被写入到数组。
off
-起始位置在
b
写。
len
-的最大字节数读。
-1
指示EOF。
IndexOutOfBoundsException
-如果
off
是负的,
len
是负的,或
off + len
大于
b.length
。
null
b
NullPointerException
。
IOException
如果I/O错误发生。
public void readBytes(IIOByteBuffer buf, int len) throws IOException
ImageInputStream
len
字节,并修改所提供的
IIOByteBuffer
表示字节数组,偏移,和长度的数据可以发现。打电话的人不应该试图修改数据的
IIOByteBuffer
发现。
在流中的位偏移量在读取发生之前重置为零。
readBytes
接口
ImageInputStream
buf
- iiobytebuffer对象被修改。
len
-
byte
s最大数读。
IOException
如果I/O错误发生。
public boolean readBoolean() throws IOException
ImageInputStream
true
boolean
价值,
false
如果是零。
在流中的位偏移量在读取发生之前重置为零。
readBoolean
接口
DataInput
readBoolean
接口
ImageInputStream
EOFException
如果到达流的末尾。
IOException
如果I/O错误发生。
public byte readByte() throws IOException
ImageInputStream
byte
价值。
0x00
和
0x7f
之间的字节值代表
0
和
127
之间的整数的值。
0x80
和
0xff
之间的值表示从
在流中的位偏移量在读取发生之前重置为零。
/1
-128
负值。
readByte
接口
DataInput
readByte
接口
ImageInputStream
EOFException
如果到达流的末尾。
IOException
如果I/O错误发生。
public int readUnsignedByte() throws IOException
ImageInputStream
0xff
为了脱掉任何符号扩展位,并将其作为
byte
价值。
因此,0x00
和0x7f
之间的字节值只是返回0
和127
之间的整数的值。0x80
和0xff
之间的值,通常是负面的byte
values,将映射到128
和255
之间的正整数。
在流中的位偏移量在读取发生之前重置为零。
readUnsignedByte
接口
DataInput
readUnsignedByte
接口
ImageInputStream
EOFException
如果到达流的末尾。
IOException
如果I/O错误发生。
public short readShort() throws IOException
ImageInputStream
short
值返回结果。
在流中的位偏移量在读取发生之前重置为零。
readShort
接口
DataInput
readShort
接口
ImageInputStream
EOFException
如果流到达终点之前阅读所有字节。
IOException
如果I/O错误发生。
ImageInputStream.getByteOrder()
public int readUnsignedShort() throws IOException
ImageInputStream
int
,面具与
0xffff
为了脱掉任何符号扩展,但是,作为一个符号
int
值返回结果。
在流中的位偏移量在读取发生之前重置为零。
readUnsignedShort
接口
DataInput
readUnsignedShort
接口
ImageInputStream
EOFException
如果流到达终点之前阅读所有字节。
IOException
如果I/O错误发生。
ImageInputStream.getByteOrder()
public char readChar() throws IOException
ImageInputStream
readUnsignedShort
,除了返回的结果是使用
char
数据类型。
在流中的位偏移量在读取发生之前重置为零。
readChar
接口
DataInput
readChar
接口
ImageInputStream
EOFException
如果流到达终点之前阅读所有字节。
IOException
如果I/O错误发生。
ImageInputStream.readUnsignedShort()
public int readInt() throws IOException
ImageInputStream
int
返回结果。
流中的位偏移量被忽略,并处理过,好像它是零。
readInt
接口
DataInput
readInt
接口
ImageInputStream
EOFException
如果流到达终点之前阅读所有字节。
IOException
如果I/O错误发生。
ImageInputStream.getByteOrder()
public long readUnsignedInt() throws IOException
ImageInputStream
0xffffffffL
为了脱掉任何符号扩展位,作为一个符号
long
值返回结果。
在流中的位偏移量在读取发生之前重置为零。
readUnsignedInt
接口
ImageInputStream
EOFException
如果流到达终点之前阅读所有字节。
IOException
如果I/O错误发生。
ImageInputStream.getByteOrder()
public long readLong() throws IOException
ImageInputStream
long
返回结果。
在流中的位偏移量在读取发生之前重置为零。
readLong
接口
DataInput
readLong
接口
ImageInputStream
EOFException
如果流到达终点之前阅读所有字节。
IOException
如果I/O错误发生。
ImageInputStream.getByteOrder()
public float readFloat() throws IOException
ImageInputStream
float
返回结果。
在流中的位偏移量在读取发生之前重置为零。
readFloat
接口
DataInput
readFloat
接口
ImageInputStream
EOFException
如果流到达终点之前阅读所有字节。
IOException
如果I/O错误发生。
ImageInputStream.getByteOrder()
public double readDouble() throws IOException
ImageInputStream
double
返回结果。
在流中的位偏移量在读取发生之前重置为零。
readDouble
接口
DataInput
readDouble
接口
ImageInputStream
EOFException
如果流到达终点之前阅读所有字节。
IOException
如果I/O错误发生。
ImageInputStream.getByteOrder()
public String readLine() throws IOException
ImageInputStream
String
然后返回。请注意,因为此方法处理字节,它不支持完整的Unicode字符集的输入。
如果文件结束之前遇到甚至一个字节可以读取,然后null
返回。否则,每个字节读取由零扩展转换为类型char
。如果遇到的是性格'\n'
,它是被丢弃的,阅读时。如果遇到的是性格'\r'
,就丢弃,如果下面的字节转换为字符'\n'
,然后被丢弃的也;阅读然后停止。如果文件结束之前遇到的人物'\n'
和'\r'
时,停止阅读。一旦阅读已经停止,一个String
返回包含所有字符读不丢弃,以。请注意,此字符串中的每个字符都有一个值小于\u0100
,即(char)256
。
在流中的位偏移量在读取发生之前重置为零。
readLine
接口
DataInput
readLine
接口
ImageInputStream
IOException
如果I/O错误发生。
public String readUTF() throws IOException
ImageInputStream
readUTF
一般合同,它读取Unicode字符串在改进后的UTF-8编码格式的表示;这个字符串是作为
String
返回。
首先,两字节读取和使用的方式readUnsignedShort
方法构建一个16位无符号整数,使用网络字节顺序(无论当前字节顺序设置)。这个整数的值称为utf长度和指定要读取额外的字节数。这些字节,然后转换为字符,考虑他们在组。每个组的长度是从组的第一个字节的值计算的。一组下面的字节,如果有的话,是下一组的第一个字节。
如果一个组的第一个字节和位模式0xxxxxxx
(其中x
意味着“可能0
或1
”),然后组只包括字节。字节为零扩展到形成字符。
如果一个组的第一个字节和位模式110xxxxx
,然后小组组成的字节a
和第二字节b
。如果没有字节b
(因为字节a
是最后一个字节被读取),或如果字节b
不匹配的位模式10xxxxxx
,然后UTFDataFormatException
抛出。否则,将该组转换为字符:
(char)(((a& 0x1F) << 6) | (b & 0x3F))
如果一组的第一个字节和位模式
1110xxxx
,然后小组组成的字节
a
和两个字节
b
和
c
。如果没有字节
c
(因为字节
a
是一个字节的最后两读入),或
b
字节或字节
c
不匹配的位模式
10xxxxxx
,然后
UTFDataFormatException
抛出。否则,该组转换为字符:
(char)(((a & 0x0F) << 12) | ((b & 0x3F) << 6) | (c & 0x3F))
如果一组的第一个字节匹配模式
1111xxxx
或模式
10xxxxxx
,然后
UTFDataFormatException
抛出。
如果文件结束时在任何时间,在这个过程中,然后java.io.EOFException
抛出。
在每一组已转化为这一过程的一个人物,人物都聚集在一起,在同一顺序中相应组从输入流中读取,以形成一个String
,返回的。
当前字节顺序设置被忽略。
在流中的位偏移量在读取发生之前重置为零。
注:此方法不能用于图像格式,使用标准的UTF-8的实施,因为修改UTF-8用在这里是标准的UTF-8不相容。
readUTF
接口
DataInput
readUTF
接口
ImageInputStream
EOFException
如果流到达终点之前阅读所有字节。
UTFDataFormatException
如果字节没有表示一个有效的修改一个字符串编码UTF-8。
IOException
如果I/O错误发生。
public void readFully(byte[] b, int off, int len) throws IOException
ImageInputStream
len
字节流,并将它们存储到
b
从指数
off
。如果到达流的末尾,一个
java.io.EOFException
将抛出。
在流中的位偏移量在读取发生之前重置为零。
readFully
接口
DataInput
readFully
接口
ImageInputStream
b
-字节被写入到数组。
off
-起始位置在
b
写。
len
-
byte
s最大数读。
EOFException
如果流到达终点之前阅读所有字节。
IOException
如果I/O错误发生。
public void readFully(byte[] b) throws IOException
ImageInputStream
b.length
字节流,并将它们存储到
b
从指数
0
。如果到达流的末尾,一个
java.io.EOFException
将抛出。
在流中的位偏移量在读取发生之前重置为零。
readFully
接口
DataInput
readFully
接口
ImageInputStream
b
-
byte
s数组。
EOFException
如果流到达终点之前阅读所有字节。
IOException
如果I/O错误发生。
public void readFully(short[] s, int off, int len) throws IOException
ImageInputStream
len
短裤(有符号的16位整数)从流根据当前字节顺序,并将它们存储到
s
从指数
off
。如果到达流的末尾,一个
java.io.EOFException
将抛出。
在流中的位偏移量在读取发生之前重置为零。
readFully
接口
ImageInputStream
s
-短裤被写入数组。
off
-起始位置在
s
写。
len
-
short
s最大数读。
EOFException
如果流到达终点之前阅读所有字节。
IOException
如果I/O错误发生。
public void readFully(char[] c, int off, int len) throws IOException
ImageInputStream
len
字符(16位无符号整数)从流根据当前字节顺序,并将它们存储到
c
从指数
off
。如果到达流的末尾,一个
java.io.EOFException
将抛出。
在流中的位偏移量在读取发生之前重置为零。
readFully
接口
ImageInputStream
c
-字符被写入数组。
off
-起始位置在
c
写。
len
-
char
s最大数读。
EOFException
如果流到达终点之前阅读所有字节。
IOException
如果I/O错误发生。
public void readFully(int[] i, int off, int len) throws IOException
ImageInputStream
len
整型(签署从流32位整数)根据当前的字节顺序,并将它们存储到
i
从指数
off
。如果到达流的末尾,一个
java.io.EOFException
将抛出。
在流中的位偏移量在读取发生之前重置为零。
readFully
接口
ImageInputStream
i
-整数写入数组。
off
-起始位置在
i
写。
len
-
int
s最大数读。
EOFException
如果流到达终点之前阅读所有字节。
IOException
如果I/O错误发生。
public void readFully(long[] l, int off, int len) throws IOException
ImageInputStream
len
多头(符号的64位整数)从流根据当前字节顺序,并将它们存储到
l
从指数
off
。如果到达流的末尾,一个
java.io.EOFException
将抛出。
在流中的位偏移量在读取发生之前重置为零。
readFully
接口
ImageInputStream
l
-一系列的渴望被写入。
off
-起始位置在
l
写。
len
-
long
s最大数读。
EOFException
如果流到达终点之前阅读所有字节。
IOException
如果I/O错误发生。
public void readFully(float[] f, int off, int len) throws IOException
ImageInputStream
len
花车(32位IEEE单精度浮)从流根据当前字节顺序,并将它们存储到
f
从指数
off
。如果到达流的末尾,一个
java.io.EOFException
将抛出。
在流中的位偏移量在读取发生之前重置为零。
readFully
接口
ImageInputStream
f
-彩车要写入数组。
off
-起始位置在
f
写。
len
-
float
s最大数读。
EOFException
如果流到达终点之前阅读所有字节。
IOException
如果I/O错误发生。
public void readFully(double[] d, int off, int len) throws IOException
ImageInputStream
len
双打(64位IEEE双精度浮点数)从流根据当前字节顺序,并将它们存储到
d
从指数
off
。如果到达流的末尾,一个
java.io.EOFException
将抛出。
在流中的位偏移量在读取发生之前重置为零。
readFully
接口
ImageInputStream
d
-双打被写入数组。
off
-起始位置在
d
写。
len
-
double
s最大数读。
EOFException
如果流到达终点之前阅读所有字节。
IOException
如果I/O错误发生。
public long getStreamPosition() throws IOException
ImageInputStream
getStreamPosition
接口
ImageInputStream
IOException
如果I/O错误发生。
public int getBitOffset() throws IOException
ImageInputStream
readBits
更新方法。一个值为0表示最重要的位,和一个值为7表示最不显着的位,被读取的字节。
位偏移设置为0流时先打开,并设置为0的电话seek
,skipBytes
,或任何read
或readFully
方法。
getBitOffset
接口
ImageInputStream
int
含0和7之间的偏位,包容。
IOException
如果I/O错误发生。
ImageInputStream.setBitOffset(int)
public void setBitOffset(int bitOffset) throws IOException
ImageInputStream
getStreamPosition
,保持不变。一个值为0表示最重要的位,和一个值为7表示最不显着的位,被读取的字节。
setBitOffset
接口
ImageInputStream
bitOffset
-所需的偏移量,在0和7之间的
int
,包容。
IOException
如果I/O错误发生。
ImageInputStream.getBitOffset()
public int readBit() throws IOException
ImageInputStream
0
或
1
一
int
。位偏移是先进一降低模8。
readBit
接口
ImageInputStream
int
含有值的
0
或
1
。
EOFException
如果流到达终点之前阅读所有位。
IOException
如果I/O错误发生。
public long readBits(int numBits) throws IOException
ImageInputStream
long
,与第一位读成为输出最重要的位。开始读的字节表示的
getStreamPosition
,在给定的
getBitOffset
钻头。位偏移是先进的
numBits
降低模8。
流的字节顺序对这个方法没有影响。该方法的返回值被构造成一个在一个时间点上读取一个位,并将其转换为返回值的右边,如下面的伪代码所示:
long accum = 0L;
for (int i = 0; i < numBits; i++) {
accum <<= 1; // Shift left one bit to make room
accum |= readBit();
}
注意
readBits(32)
结果可能不会如反网络字节顺序是相同,
readInt()
(即
getByteOrder() == false
)。
如果流的结束之前遇到的所有碎片已被阅读,一个java.io.EOFException
抛出。
readBits
接口
ImageInputStream
numBits
-读取的字节数,如0和64之间的一个
int
,包容。
long
读取存储在最低有效位。
EOFException
如果流到达终点之前阅读所有位。
IOException
如果I/O错误发生。
public long length()
-1L
表明流具有未知的长度。子类必须重写此方法以提供实际的长度信息。
length
接口
ImageInputStream
public int skipBytes(int n) throws IOException
seek(getStreamPosition() + n)
。
位偏移量被重置为零。
skipBytes
接口
DataInput
skipBytes
接口
ImageInputStream
n
-字节数寻求。
int
跳过的字节数。
IOException
-如果
getStreamPosition
抛出一个
IOException
当计算的起始或结束位置。
public long skipBytes(long n) throws IOException
seek(getStreamPosition() + n)
。
位偏移量被重置为零。
skipBytes
接口
ImageInputStream
n
-字节数寻求。
long
表示字节数跳过。
IOException
-如果
getStreamPosition
抛出一个
IOException
当计算的起始或结束位置。
public void seek(long pos) throws IOException
ImageInputStream
如果将一个IndexOutOfBoundsException
pos
小于冲洗位置抛出(返回的getflushedPosition
)。
它寻找过去的文件是合法的;一个java.io.EOFException
才可以执行读扔。
seek
接口
ImageInputStream
pos
-
long
含有所需的文件指针的位置。
IOException
-如果任何其他发生I/O错误。
public void mark()
mark
接口
ImageInputStream
public void reset() throws IOException
一个IOException
将如果先前标记的位置位于废弃的流部分抛出。
reset
接口
ImageInputStream
IOException
如果I/O错误发生。
public void flushBefore(long pos) throws IOException
ImageInputStream
IndexOutOfBoundsException
。
打电话flushBefore
允许实现了这个接口的类来释放资源如内存或磁盘空间被用来存储数据流。
flushBefore
接口
ImageInputStream
pos
-
long
含流前缀可能冲长度。
IOException
如果I/O错误发生。
public void flush() throws IOException
ImageInputStream
flushBefore(getStreamPosition())
。
flush
接口
ImageInputStream
IOException
如果I/O错误发生。
public long getFlushedPosition()
ImageInputStream
flushBefore
最大。
getFlushedPosition
接口
ImageInputStream
long
。
public boolean isCached()
isCached
接口
ImageInputStream
true
ImageInputStream
缓存数据。
ImageInputStream.isCachedMemory()
,
ImageInputStream.isCachedFile()
public boolean isCachedMemory()
isCachedMemory
接口
ImageInputStream
true
ImageInputStream
缓存在内存中的数据。
ImageInputStream.isCached()
,
ImageInputStream.isCachedFile()
public boolean isCachedFile()
isCachedFile
接口
ImageInputStream
true
ImageInputStream
缓存数据在一个临时文件。
ImageInputStream.isCached()
,
ImageInputStream.isCachedMemory()
public void close() throws IOException
ImageInputStream
IOException
s或不正确的行为。调用此方法可允许类实现此接口,以释放与流关联的资源,如内存、磁盘空间或文件描述符。
close
接口
Closeable
close
接口
AutoCloseable
close
接口
ImageInputStream
IOException
如果I/O错误发生。
protected void finalize() throws Throwable
close
方法来关闭任何打开的输入源。此方法不应该从应用程序代码调用。
finalize
方法重写,继承类
Object
Throwable
-如果在父类定型时发生错误。
WeakReference
,
PhantomReference
Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Copyright © 1993, 2014, Oracle and/or its affiliates. All rights reserved.