- java.lang.Object
-
- javax.imageio.stream.ImageInputStreamImpl
-
- javax.imageio.stream.ImageOutputStreamImpl
-
- javax.imageio.stream.FileImageOutputStream
-
- 实现的所有接口
-
Closeable
,DataInput
,DataOutput
,AutoCloseable
,ImageInputStream
,ImageOutputStream
public class FileImageOutputStreamextends ImageOutputStreamImpl
ImageOutputStream
的实现,将其输出直接写入File
或RandomAccessFile
。
-
-
字段汇总
-
声明的属性在类 javax.imageio.stream.ImageInputStreamImpl
bitOffset, byteOrder, flushedPos, streamPos
-
-
构造方法摘要
构造方法 构造器 描述 FileImageOutputStream(File f)
构造一个FileImageOutputStream
,它将写入给定的File
。FileImageOutputStream(RandomAccessFile raf)
构造一个FileImageOutputStream
,它将写入给定的RandomAccessFile
。
-
方法摘要
所有方法 实例方法 具体的方法 弃用的方法 变量和类型 方法 描述 protected void
finalize()
已过时。finalize
方法已被弃用。void
seek(long pos)
设置当前流位置并将位偏移重置为0。-
声明方法的类 javax.imageio.stream.ImageOutputStreamImpl
flushBits
-
声明方法的类 javax.imageio.stream.ImageInputStreamImpl
checkClosed, isCached, isCachedFile, isCachedMemory, length, mark, read, read, read, reset, skipBytes, skipBytes
-
声明方法的类 java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
声明方法的接口 javax.imageio.stream.ImageInputStream
close, flush, getBitOffset, getByteOrder, getFlushedPosition, getStreamPosition, isCached, isCachedFile, isCachedMemory, length, mark, read, read, read, readBit, readBits, readBoolean, readByte, readBytes, readChar, readDouble, readFloat, readFully, readFully, readFully, readFully, readFully, readFully, readFully, readFully, readInt, readLine, readLong, readShort, readUnsignedByte, readUnsignedInt, readUnsignedShort, readUTF, reset, setBitOffset, setByteOrder, skipBytes, skipBytes
-
声明方法的接口 javax.imageio.stream.ImageOutputStream
flushBefore, write, write, write, writeBit, writeBits, writeBoolean, writeByte, writeBytes, writeChar, writeChars, writeChars, writeDouble, writeDoubles, writeFloat, writeFloats, writeInt, writeInts, writeLong, writeLongs, writeShort, writeShorts, writeUTF
-
-
-
-
构造方法详细信息
-
FileImageOutputStream
public FileImageOutputStream(File f) throws FileNotFoundException, IOException
构造一个FileImageOutputStream
,它将写入给定的File
。- 参数
-
f
- 写一个File
。 - 异常
-
IllegalArgumentException
- 如果f
是null
。 -
SecurityException
- 如果存在安全管理器且不允许对文件进行写访问。 -
FileNotFoundException
- 如果f
不表示常规文件,或者由于任何其他原因无法打开进行读写操作。 -
IOException
- 如果发生I / O错误。
-
FileImageOutputStream
public FileImageOutputStream(RandomAccessFile raf)
构造一个FileImageOutputStream
,它将写入给定的RandomAccessFile
。- 参数
-
raf
- 写一个RandomAccessFile
。 - 异常
-
IllegalArgumentException
- 如果raf
是null
。
-
-
方法详细信息
-
seek
public void seek(long pos) throws IOException
设置当前流的位置并将位偏移重置为0.寻找超过文件末尾是合法的; 仅在执行读取时才会抛出EOFException
。 在执行写入之前,文件长度不会增加。- 参数
-
pos
- 包含所需文件指针位置的long
。 - 异常
-
IndexOutOfBoundsException
- 如果pos
小于刷新位置。 -
IOException
- 如果发生任何其他I / O错误。
-
finalize
@Deprecated(since="9")protected void finalize() throws Throwable
Deprecated.Thefinalize
method has been deprecated. Subclasses that overridefinalize
in order to perform cleanup should be modified to use alternative cleanup mechanisms and to remove the overridingfinalize
method. When overriding thefinalize
method, its implementation must explicitly ensure thatsuper.finalize()
is invoked as described inObject.finalize()
. See the specification forObject.finalize()
for further information about migration options.在垃圾回收之前完成此对象。 调用close
方法关闭任何打开的输入源。 不应从应用程序代码调用此方法。- 重写:
-
finalize
类ImageInputStreamImpl
- 异常
-
Throwable
- 如果在超类完成期间发生错误。 - 另请参见:
-
WeakReference
,PhantomReference
-
-