📄 imageinputstream.java
字号:
/* ImageInputStream.java Copyright (C) 2004, 2005 Free Software Foundation, Inc.This file is part of GNU Classpath.GNU Classpath is free software; you can redistribute it and/or modifyit under the terms of the GNU General Public License as published bythe Free Software Foundation; either version 2, or (at your option)any later version.GNU Classpath is distributed in the hope that it will be useful, butWITHOUT ANY WARRANTY; without even the implied warranty ofMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNUGeneral Public License for more details.You should have received a copy of the GNU General Public Licensealong with GNU Classpath; see the file COPYING. If not, write to theFree Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA02110-1301 USA.Linking this library statically or dynamically with other modules ismaking a combined work based on this library. Thus, the terms andconditions of the GNU General Public License cover the wholecombination.As a special exception, the copyright holders of this library give youpermission to link this library with independent modules to produce anexecutable, regardless of the license terms of these independentmodules, and to copy and distribute the resulting executable underterms of your choice, provided that you also meet, for each linkedindependent module, the terms and conditions of the license of thatmodule. An independent module is a module which is not derived fromor based on this library. If you modify this library, you may extendthis exception to your version of the library, but you are notobligated to do so. If you do not wish to do so, delete thisexception statement from your version. */package javax.imageio.stream;import java.io.DataInput;import java.io.EOFException;import java.io.IOException;import java.nio.ByteOrder;/** * An input stream for use by {@link javax.imageio.ImageReader * ImageReaders}. * * @since 1.4 * * @author Sascha Brawer (brawer@dandelis.ch) */public interface ImageInputStream extends DataInput{ void setByteOrder(ByteOrder order); ByteOrder getByteOrder(); int read() throws IOException; int read(byte[] b) throws IOException; int read(byte[] b, int offset, int length) throws IOException; /** * Reads up to a specified number of bytes, and modifies a * {@link IIOByteBuffer} to hold the read data. * * <p>The {@linkplain #getBitOffset() bit offset} is set to zero * before any data is read. * * @param buf an <code>IIOByteBuffer</code> that will hold the read * data. * * @param numBytes the maximum number of bytes to read. * * @throws IndexOutOfBoundsException if <code>numBytes</code> is * negative. * * @throws NullPointerException if <code>buf</code> is * <code>null</code>. * * @throws IOException if some general problem happens with * accessing data. */ void readBytes(IIOByteBuffer buf, int numBytes) throws IOException; /** * Reads a byte and checks whether or not its value is zero. * * <p>The {@linkplain #getBitOffset() bit offset} is set to zero * before the byte is read. * * @throws EOFException if the input stream is at its end. * * @throws IOException if some general problem happens with * accessing data. * * @see #readBit() * @see #readByte() * @see #readFully(byte[], int, int) */ boolean readBoolean() throws IOException; /** * Reads a signed byte. * * <p>The {@linkplain #getBitOffset() bit offset} is set to zero * before any data is read. * * @throws EOFException if the input stream is at its end. * * @throws IOException if some general problem happens with * accessing data. * * @see #readUnsignedByte() * @see #readFully(byte[], int, int) */ byte readByte() throws IOException; /** * Reads an unsigned byte. * * <p>The {@linkplain #getBitOffset() bit offset} is set to zero * before any data is read. * * @throws EOFException if the input stream is at its end. * * @throws IOException if some general problem happens with * accessing data. * * @see #readByte() * @see #readFully(byte[], int, int) */ int readUnsignedByte() throws IOException; /** * Reads an signed 16-bit integer. If necessary, the value gets * converted from the stream’s {@linkplain #getByteOrder() * current byte order}. * * <p>The {@linkplain #getBitOffset() bit offset} is set to zero * before any data is read. * * @throws EOFException if the input stream ends before all two * bytes were read. * * @throws IOException if some general problem happens with * accessing data. * * @see #readUnsignedShort() * @see #readChar() * @see #readFully(short[], int, int) */ short readShort() throws IOException; /** * Reads an unsigned 16-bit integer. If necessary, the value gets * converted from the stream’s {@linkplain #getByteOrder() * current byte order}. * * <p>The {@linkplain #getBitOffset() bit offset} is set to zero * before any data is read. * * <p>This method does the same as {@link #readChar()}. * * @throws EOFException if the input stream ends before all two * bytes were read. * * @throws IOException if some general problem happens with * accessing data. * * @see #readShort() * @see #readChar() * @see #readFully(char[], int, int) */ int readUnsignedShort() throws IOException; /** * Reads an unsigned 16-bit integer. If necessary, the value gets * converted from the stream’s {@linkplain #getByteOrder() * current byte order}. * * <p>The {@linkplain #getBitOffset() bit offset} is set to zero * before any data is read. * * <p>This method does the same as {@link #readUnsignedShort()}. * * @throws EOFException if the input stream ends before all two * bytes were read. * * @throws IOException if some general problem happens with * accessing data. * * @see #readFully(char[], int, int) */ char readChar() throws IOException; /** * Reads a signed 32-bit integer. If necessary, the value gets * converted from the stream’s {@linkplain #getByteOrder() * current byte order}. * * <p>The {@linkplain #getBitOffset() bit offset} is set to zero * before any data is read. * * @throws EOFException if the input stream ends before all four * bytes were read. * * @throws IOException if some general problem happens with * accessing data. * * @see #readUnsignedInt() * @see #readFully(int[], int, int) */ int readInt() throws IOException; /** * Reads an unsigned 32-bit integer. If necessary, the value gets * converted from the stream’s {@linkplain #getByteOrder() * current byte order}. * * <p>The {@linkplain #getBitOffset() bit offset} is set to zero * before any data is read. * * @throws EOFException if the input stream ends before all four * bytes were read. * * @throws IOException if some general problem happens with * accessing data. * * @see #readInt() * @see #readFully(int[], int, int) */ long readUnsignedInt() throws IOException; /** * Reads a signed 64-bit integer. If necessary, the value gets * converted from the stream’s {@linkplain #getByteOrder() * current byte order}. * * <p>The {@linkplain #getBitOffset() bit offset} is set to zero * before any data is read. * * @throws EOFException if the input stream ends before all eight * bytes were read. * * @throws IOException if some general problem happens with * accessing data. * * @see #readFully(long[], int, int) */ long readLong() throws IOException; /** * Reads an IEEE 32-bit single-precision floating point number. If * necessary, the value gets converted from the stream’s * {@linkplain #getByteOrder() current byte order}. * * <p>The {@linkplain #getBitOffset() bit offset} is set to zero * before any data is read. * * @throws EOFException if the input stream ends before all four * bytes were read. * * @throws IOException if some general problem happens with * accessing data. * * @see #readFully(float[], int, int) */ float readFloat() throws IOException; /** * Reads an IEEE 64-bit double-precision floating point number. If * necessary, the value gets converted from the stream’s * {@linkplain #getByteOrder() current byte order}. * * <p>The {@linkplain #getBitOffset() bit offset} is set to zero * before any data is read. * * @throws EOFException if the input stream ends before all eight * bytes were read. * * @throws IOException if some general problem happens with * accessing data. * * @see #readFully(double[], int, int) */ double readDouble() throws IOException; String readLine() throws IOException; String readUTF() throws IOException;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -