|
JavaTM 2 Platform Standard Ed. 5.0 |
|||||||||
| 前のクラス 次のクラス | フレームあり フレームなし | |||||||||
| 概要: 入れ子 | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド | |||||||||
java.lang.Objectjavax.imageio.stream.ImageInputStreamImpl
javax.imageio.stream.ImageOutputStreamImpl
javax.imageio.stream.FileImageOutputStream
public class FileImageOutputStream
出力を File または RandomAccessFile に直接書き込む ImageOutputStream の実装です。
| フィールドの概要 |
|---|
| クラス javax.imageio.stream.ImageInputStreamImpl から継承されたフィールド |
|---|
bitOffset, byteOrder, flushedPos, streamPos |
| コンストラクタの概要 | |
|---|---|
FileImageOutputStream(File f)
指定された File に書き込む FileImageOutputStream を構築します。 |
|
FileImageOutputStream(RandomAccessFile raf)
指定された RandomAccessFile に書き込む FileImageOutputStream を構築します。 |
|
| メソッドの概要 | |
|---|---|
void |
close()
ストリームを閉じます。 |
long |
length()
ストリームが未知の長さであることを示す -1L を返します。 |
int |
read()
ストリームから 1 バイトを読み込み、それを 0 から 255 までの整数として返します。 |
int |
read(byte[] b,
int off,
int len)
ストリームから len バイトまで読み込み、b にインデックス off から格納します。 |
void |
seek(long pos)
現在のストリーム位置を設定してビットオフセットを 0 にリセットします。 |
void |
write(byte[] b,
int off,
int len)
配列 b から len バイトを順番に出力ストリームに書き込みます。 |
void |
write(int b)
引数 b の下位 8 ビットを出力ストリームに書き込みます。 |
| クラス javax.imageio.stream.ImageOutputStreamImpl から継承されたメソッド |
|---|
flushBits, write, writeBit, writeBits, writeBoolean, writeByte, writeBytes, writeChar, writeChars, writeChars, writeDouble, writeDoubles, writeFloat, writeFloats, writeInt, writeInts, writeLong, writeLongs, writeShort, writeShorts, writeUTF |
| クラス javax.imageio.stream.ImageInputStreamImpl から継承されたメソッド |
|---|
checkClosed, finalize, 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, skipBytes |
| クラス java.lang.Object から継承されたメソッド |
|---|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| インタフェース javax.imageio.stream.ImageOutputStream から継承されたメソッド |
|---|
flushBefore |
| インタフェース javax.imageio.stream.ImageInputStream から継承されたメソッド |
|---|
flush, 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, skipBytes |
| コンストラクタの詳細 |
|---|
public FileImageOutputStream(File f)
throws FileNotFoundException,
IOException
File に書き込む FileImageOutputStream を構築します。
f - 書き込み先の File
IllegalArgumentException - f が null の場合
SecurityException - セキュリティマネージャが存在し、ファイルへの書き込みアクセスが許可されない場合
FileNotFoundException - f が普通のファイルを示していないか、ほかの何らかの理由で読み込みおよび書き込み用に開くことができない場合
IOException - 入出力エラーが発生した場合public FileImageOutputStream(RandomAccessFile raf)
RandomAccessFile に書き込む FileImageOutputStream を構築します。
raf - 書き込み先の RandomAccessFile
IllegalArgumentException - raf が null の場合| メソッドの詳細 |
|---|
public int read()
throws IOException
ImageInputStream の記述: ストリーム内のビットオフセットは、読み込みを行う前に 0 にリセットされます。
ImageInputStream 内の readImageInputStreamImpl 内の readIOException - 入出力エラーが発生した場合
public int read(byte[] b,
int off,
int len)
throws IOException
ImageInputStreamImpl の記述: len バイトまで読み込み、b にインデックス off から格納します。読み込んだバイト数を返します。ストリームの終りに達したためにバイトを読み込めない場合は、-1 を返します。
ストリーム内のビットオフセットは、読み込みを行う前に 0 にリセットする必要があります。
サブクラスでこのメソッドを実装する必要があります。サブクラス実装で終了する前にストリーム位置を更新します。
ImageInputStream 内の readImageInputStreamImpl 内の readb - 書き込まれるバイト配列off - 書き込み先の b 内の開始位置len - 読み込む最大バイト数
-1
IOException - 入出力エラーが発生した場合
public void write(int b)
throws IOException
DataOutput の記述: b の下位 8 ビットを出力ストリームに書き込みます。b の上位 24 ビットについては無視されます。
DataOutput 内の writeImageOutputStream 内の writeImageOutputStreamImpl 内の writeb - 書き込むバイト
IOException - 入出力エラーが発生した場合
public void write(byte[] b,
int off,
int len)
throws IOException
DataOutput の記述: b から len バイトを順番に出力ストリームに書き込みます。b が null の場合は、NullPointerException がスローされます。off が負の値の場合、len が負の値の場合、あるいは off+len が配列 b の長さより大きい場合には、IndexOutOfBoundsException がスローされます。len がゼロの場合、書き込まれるバイトはありません。そうでない場合は、まずバイト b[off]、次に b[off+1] と順次書き込まれ、最後にバイト b[off+len-1] が書き込まれます。
DataOutput 内の writeImageOutputStream 内の writeImageOutputStreamImpl 内の writeb - データoff - データの開始オフセットlen - 書き込むバイト数
IOException - 入出力エラーが発生した場合public long length()
ImageInputStreamImpl の記述: -1L を返します。サブクラスでこのメソッドをオーバーライドして、実際の長さの情報を指定する必要があります。
ImageInputStream 内の lengthImageInputStreamImpl 内の length
public void seek(long pos)
throws IOException
EOFException は読み込みの場合にのみスローされます。書き込みが実行されるまで、ファイル長は増加しません。
ImageInputStream 内の seekImageInputStreamImpl 内の seekpos - 目的のファイルポインタ位置を示す long
IndexOutOfBoundsException - pos がフラッシュ位置よりも小さい場合
IOException - その他の入出力エラーが発生した場合
public void close()
throws IOException
ImageInputStream の記述: IOException がスローされるか不正な動作が実行される場合があります。このメソッドを呼び出すと、このインタフェースを実装するクラスが、メモリ、ディスクスペース、またはファイル記述子などのストリームに関連するリソースを解放できます。
ImageInputStream 内の closeImageInputStreamImpl 内の closeIOException - 入出力エラーが発生した場合
|
JavaTM 2 Platform Standard Ed. 5.0 |
|||||||||
| 前のクラス 次のクラス | フレームあり フレームなし | |||||||||
| 概要: 入れ子 | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド | |||||||||
Copyright 2004 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms. Documentation Redistribution Policy も参照してください。