| |||||||||
摘要: 嵌套 | 字段 | 构造方法 | 方法 | 详细信息: 字段 | 构造方法 | 方法 |
javax.imageio.stream
类 ImageOutputStreamImpl
java.lang.Object javax.imageio.stream.ImageInputStreamImpl javax.imageio.stream.ImageOutputStreamImpl
- 所有已实现的接口:
- DataInput, DataOutput, ImageInputStream, ImageOutputStream
public abstract class ImageOutputStreamImpl
- extends ImageInputStreamImpl
- implements ImageOutputStream
实现 ImageOutputStream
接口的抽象类。此类设计用于减少必须由子类实现的方法数。
字段摘要 |
---|
从类 javax.imageio.stream.ImageInputStreamImpl 继承的字段 |
---|
bitOffset, byteOrder, flushedPos, streamPos |
构造方法摘要 | |
---|---|
ImageOutputStreamImpl() 构造一个 ImageOutputStreamImpl 。 |
方法摘要 | |
---|---|
protected void | flushBits() 如果位偏移量为非零,则将当前字节中的剩余位强制归 0,并将流位置前移一个字节。 |
void | write(byte[] b) 将字节序列写入到流中的当前位置。 |
abstract void | write(byte[] b, int off, int len) 将字节序列写入到流中的当前位置。 |
abstract void | write(int b) 将单个字节写入到流中的当前位置。 |
void | writeBit(int bit) 将单个位(由参数的最低有效位给定)写入到流的当前字节位置中的当前位偏移量。 |
void | writeBits(long bits, int numBits) 将一个位序列(由 bits 参数的 numBits 个最低有效位按从左到右的顺序给定)写入到流的当前字节位置中的当前位偏移量。 |
void | writeBoolean(boolean v) 将一个 boolean 值写入到流中。 |
void | writeByte(int v) 将 v 的 8 个低位写入到流中。 |
void | writeBytes(String s) 将一个字符串写入输出流。 |
void | writeChar(int v) 此方法与 同义。 |
void | writeChars(char[] c, int off, int len) 将 char 序列写入到流中的当前位置。 |
void | writeChars(String s) 将一个字符串写入输出流。 |
void | writeDouble(double v) 将一个 double 值写入输出流,该值由四个字节组成。 |
void | writeDoubles(double[] d, int off, int len) 将 double 序列写入到流中的当前位置。 |
void | writeFloat(float v) 将一个 float 值(由四个字节组成)写入输出流。 |
void | writeFloats(float[] f, int off, int len) 将 float 序列写入到流中的当前位置。 |
void | writeInt(int v) 将 v 的 32 个位写入到流中。 |
void | writeInts(int[] i, int off, int len) 将 int 序列写入到流中的当前位置。 |
void | writeLong(long v) 将 v 的 64 个位写入到流中。 |
void | writeLongs(long[] l, int off, int len) 将 long 序列写入到流中的当前位置。 |
void | writeShort(int v) 将 v 的 16 个低位写入到流中。 |
void | writeShorts(short[] s, int off, int len) 将 short 序列写入到流中的当前位置。 |
void | writeUTF(String s) 将表示长度信息的两个字节按网络字节顺序写入输出流,后跟字符串 s 中每个字符的 UTF-8 修改版表示形式。 |
从类 javax.imageio.stream.ImageInputStreamImpl 继承的方法 |
---|
checkClosed, close, finalize, flush, flushBefore, 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, seek, setBitOffset, setByteOrder, skipBytes, skipBytes |
从类 java.lang.Object 继承的方法 |
---|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
从接口 javax.imageio.stream.ImageOutputStream 继承的方法 |
---|
flushBefore |
从接口 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, seek, setBitOffset, setByteOrder, skipBytes, skipBytes |
构造方法详细信息 |
---|
ImageOutputStreamImpl
public ImageOutputStreamImpl()
- 构造一个
ImageOutputStreamImpl
。
方法详细信息 |
---|
write
public abstract void write(int b) throws IOException
- 从接口
ImageOutputStream
复制的描述 - 将单个字节写入到流中的当前位置。
b
的 24 个高位将被忽略。如果流中的位偏移量不为零,则首先将当前字节的余项用 0 填充并将其写出。写出后位偏移量将为 0。实现方可使用
的ImageOutputStreamImpl
方法来保证这一点。flushBits
- 指定者:
- 接口
DataOutput
中的write
- 指定者:
- 接口
ImageOutputStream
中的write
- 参数:
b
- 一个int
,其低 8 位将被写入。- 抛出:
IOException
- 如果发生 I/O 错误。
write
public void write(byte[] b) throws IOException
- 从接口
ImageOutputStream
复制的描述 - 将字节序列写入到流中的当前位置。如果
b.length
为 0,则不写入任何字节。首先写入字节b[0]
,然后写入字节b[1]
,依此类推。如果流中的位偏移量不为零,则首先将当前字节的余项用 0 填充并将其写出。写出后位偏移量将为 0。
- 指定者:
- 接口
DataOutput
中的write
- 指定者:
- 接口
ImageOutputStream
中的write
- 参数:
b
- 要写入的byte
数组。- 抛出:
IOException
- 如果发生 I/O 错误。
write
public abstract void write(byte[] b, int off, int len) throws IOException
- 从接口
ImageOutputStream
复制的描述 - 将字节序列写入到流中的当前位置。如果
len
为 0,则不写入任何字节。首先写入字节b[off]
,然后写入字节b[off + 1]
,依此类推。如果流中的位偏移量不为零,则首先将当前字节的余项用 0 填充并将其写出。写出后位偏移量将为 0。实现方可使用
的ImageOutputStreamImpl
方法来保证这一点。flushBits
- 指定者:
- 接口
DataOutput
中的write
- 指定者:
- 接口
ImageOutputStream
中的write
- 参数:
b
- 要写入的byte
数组。off
- 数据中的初始偏移量。len
- 要写入的byte
数。- 抛出:
IOException
- 如果发生 I/O 错误。
writeBoolean
public void writeBoolean(boolean v) throws IOException
- 从接口
ImageOutputStream
复制的描述 - 将一个
boolean
值写入到流中。如果v
为 true,则写入值(byte)1
;如果v
为 false,则写入值(byte)0
。如果流中的位偏移量不为零,则首先将当前字节的余项用 0 填充并将其写出。写出后位偏移量将为 0。
- 指定者:
- 接口
DataOutput
中的writeBoolean
- 指定者:
- 接口
ImageOutputStream
中的writeBoolean
- 参数:
v
- 要写入的boolean
值。- 抛出:
IOException
- 如果发生 I/O 错误。
writeByte
public void writeByte(int v) throws IOException
- 从接口
ImageOutputStream
复制的描述 - 将
v
的 8 个低位写入到流中。忽略v
的 24 个高位。(这意味着writeByte
的作用与使用整数做参数的write
完全相同。)如果流中的位偏移量不为零,则首先将当前字节的余项用 0 填充并将其写出。写出后位偏移量将为 0。
- 指定者:
- 接口
DataOutput
中的writeByte
- 指定者:
- 接口
ImageOutputStream
中的writeByte
- 参数:
v
- 一个int
,包含要写入的 byte 值。- 抛出:
IOException
- 如果发生 I/O 错误。
writeShort
public void writeShort(int v) throws IOException
- 从接口
ImageOutputStream
复制的描述 - 将
v
的 16 个低位写入到流中。忽略v
的 16 个高位。如果流使用网络字节顺序,则写入的字节将依次为:(byte)((v >> 8) & 0xff) (byte)(v & 0xff)
否则,写入的字节将为:(byte)(v & 0xff) (byte)((v >> 8) & 0xff)
如果流中的位偏移量不为零,则首先将当前字节的余项用 0 填充并将其写出。写出后位偏移量将为 0。
- 指定者:
- 接口
DataOutput
中的writeShort
- 指定者:
- 接口
ImageOutputStream
中的writeShort
- 参数:
v
- 一个int
,包含要写入的 short 值。- 抛出:
IOException
- 如果发生 I/O 错误。