public class FileImageInputStream extends ImageInputStreamImpl
ImageInputStream ,从File或RandomAccessFile获取它的输入。 
       假设文件内容在对象的生存期内是稳定的。 
      bitOffset, byteOrder, flushedPos, streamPos| Constructor and Description | 
|---|
| FileImageInputStream(File f)
              构造一个 
              FileImageInputStream,它将从给定的File读取。 | 
| FileImageInputStream(RandomAccessFile raf)
              构造一个 
              FileImageInputStream,它将从给定的RandomAccessFile读取。 | 
| Modifier and Type | Method and Description | 
|---|---|
| void | close()
              关闭流。 
             | 
| protected void | finalize()
              在垃圾收集之前完成此对象。 
             | 
| long | length()
              返回底层文件的长度,如果未知,则返回 
              -1。 | 
| int | read()
              从流中读取一个字节,并将其作为0和255之间的 
              int返回。 | 
| int | read(byte[] b, int off, int len)
              从流中读取最多 
              len个字节,并将其存储在b从索引off开始。 | 
| void | seek(long pos)
              将当前流位置设置为所需位置。 
             | 
checkClosed, flush, flushBefore, getBitOffset, getByteOrder, getFlushedPosition, getStreamPosition, isCached, isCachedFile, isCachedMemory, mark, 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, skipBytespublic FileImageInputStream(File f) throws FileNotFoundException, IOException
FileImageInputStream ,将从给定的File读取。 
           文件内容不得在此对象构建时间与上一次调用read方法的时间之间发生变化。
f - a 
            File读取。 
           IllegalArgumentException - 如果 
            f是 
            null 。 
           SecurityException - 如果安全管理器存在,并且不允许对该文件的读取访问。 
           FileNotFoundException - 如果 
            f是一个目录,或由于任何其他原因无法打开阅读。 
           IOException - 如果发生I / O错误。 
           public FileImageInputStream(RandomAccessFile raf)
FileImageInputStream ,将从给定的RandomAccessFile读取。 
           文件内容不得在此对象构建时间与上一次调用read方法的时间之间发生变化。
raf - a 
            RandomAccessFile要阅读。 
           IllegalArgumentException - 如果 
            raf是 
            null 。 
           public int read()
         throws IOException 
          ImageInputStreamImpl 
          int 255之间0和如果达到EOF, -1被返回。 
           子类必须为此方法提供一个实现。 子类实现应该在退出之前更新流位置。
在发生读取之前,流内的位偏移必须重置为零。
read在接口 
            ImageInputStream 
           read在 
            ImageInputStreamImpl 
           -1 。 
           IOException - 如果流已关闭。 
           public int read(byte[] b,
                int off,
                int len)
         throws IOException 
          ImageInputStreamImpl 
          len从流字节,并将其存储到b开始于索引off 。 
           如果没有读取字节,因为已经到达流的末尾,则返回-1 。 
           在发生读取之前,流内的位偏移必须重置为零。
子类必须为此方法提供一个实现。 子类实现应该在退出之前更新流位置。
read在接口 
            ImageInputStream 
           read在 
            ImageInputStreamImpl 
           b - 要写入的字节数组。 
           off -内的起始位置 
            b写。 
           len - 要读取的最大字节数。 
           -1表示EOF。 
           IOException - 如果发生I / O错误。 
           public long length()
-1 。 
          length中的 
            ImageInputStream 
           length在 
            ImageInputStreamImpl 
           long ,或 
            -1 。 
           public void seek(long pos)
          throws IOException 
          ImageInputStream 
           一个IndexOutOfBoundsException如果将被抛出pos比冲洗位置(如通过返回较小getflushedPosition )。 
 寻求文件结尾是合法的; 一个java.io.EOFException会,如果执行读取只抛出。 
seek中的 
            ImageInputStream 
           seek在 
            ImageInputStreamImpl 
           pos -一个 
            long含有所需文件的指针位置。 
           IOException - 如果发生任何其他I / O错误。 
           public void close()
           throws IOException 
          ImageInputStream复制 
          IOException或错误的行为。 
           调用此方法可能允许实现此接口的类释放与流相关的资源,如内存,磁盘空间或文件描述符。 
          close在接口 
            Closeable 
           close在接口 
            AutoCloseable 
           close在接口 
            ImageInputStream 
           close在 
            ImageInputStreamImpl 
           IOException - 如果发生I / O错误。 
           protected void finalize()
                 throws Throwable 
          close方法来关闭任何打开的输入源。 
           不应该从应用程序代码调用此方法。 
          finalize在 
            ImageInputStreamImpl 
           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.