クラス java.io.DataOutputStream
全パッケージ  クラス階層  このパッケージ  前項目  次項目  インデックス

クラス java.io.DataOutputStream

java.lang.Object
   |
   +----java.io.OutputStream
           |
           +----java.io.FilterOutputStream
                   |
                   +----java.io.DataOutputStream

public class DataOutputStream
extends FilterOutputStream
インタフェース DataOutput
機種に依存しない方法でストリームにプリミティブな Java データ型を書き込むことを 可能にする。プリミティブなデータ型とはこのクラスのメソッドで 正しく理解される型のことである。例えば Integer はプリミティブなデータ型とみなされる。 DataInputStream を使用してデータを元に戻すことができる。

Variable Index

 o written
これまでに書き込まれたバイト数。

Constructor Index

 o DataOutputStream(OutputStream)
新しいDataOutputStreamを作成する。

Method Index

 o flush()
ストリームをフラッシュする。
 o size()
書き込まれたバイト数を返す。
 o write(int)
バイトを書き込む。
 o write(byte[], int, int)
バイトの部分配列を書き込む。
 o writeBoolean(boolean)
Booleanを書き込む。
 o writeByte(int)
8ビットbyteを書き込む。
 o writeBytes(String)
Stringをバイト列として書き込む。
 o writeChar(int)
16ビットcharを書き込む。
 o writeChars(String)
Stringを文字列として書き込む。
 o writeDouble(double)
64ビットdoubleを書き込む。
 o writeFloat(float)
32ビットfloatを書き込む。
 o writeInt(int)
32ビットintを書き込む。
 o writeLong(long)
64ビットlongを書き込む。
 o writeShort(int)
16ビットshortを書き込む。
 o writeUTF(String)
StringをUTF 形式で書き込む。

Variables

 o written
  protected int written
これまでに書き込まれたバイト数。

Constructors

 o DataOutputStream
  public DataOutputStream(OutputStream out)
新しいDataOutputStreamを作成する。
パラメータ:
out - 出力ストリーム

Methods

 o write
  public synchronized void write(int b) throws IOException
バイトを書き込む。バイトが実際に書き込まれるまで、ブロックする。
パラメータ:
b - 書き込まれるバイト
例外: IOException
I/O エラーが発生した場合。
オーバーライド:
クラス FilterOutputStreamwrite
 o write
  public synchronized void write(byte b[],
                                 int off,
                                 int len) throws IOException
バイトの部分配列を書き込む。
パラメータ:
b - 書き込まれるデータ
off - データ内の開始オフセット
len - 書き込まれるバイト数
例外: IOException
I/O エラーが発生した場合。
オーバーライド:
クラス FilterOutputStreamwrite
 o flush
  public void flush() throws IOException
ストリームをフラッシュする。これはすべてのバッファされた出力バイトを 書き込む。
例外: IOException
I/O エラーが発生した場合。
オーバーライド:
クラス FilterOutputStreamflush
 o writeBoolean
  public final void writeBoolean(boolean v) throws IOException
Booleanを書き込む。
パラメータ:
v - 書き込まれる boolean
 o writeByte
  public final void writeByte(int v) throws IOException
8ビットbyteを書き込む。
パラメータ:
v - 書き込まれるbyte値
 o writeShort
  public final void writeShort(int v) throws IOException
16ビットshortを書き込む。
パラメータ:
v - 書き込まれるshort値
 o writeChar
  public final void writeChar(int v) throws IOException
16ビットcharを書き込む。
パラメータ:
v - 書き込まれるchar値
 o writeInt
  public final void writeInt(int v) throws IOException
32ビットintを書き込む。
パラメータ:
v - 書き込まれるint値
 o writeLong
  public final void writeLong(long v) throws IOException
64ビットlongを書き込む。
パラメータ:
v - 書き込まれるlong値
 o writeFloat
  public final void writeFloat(float v) throws IOException
32ビットfloatを書き込む。
パラメータ:
v - 書き込まれるfloat値
 o writeDouble
  public final void writeDouble(double v) throws IOException
64ビットdoubleを書き込む。
パラメータ:
v - 書き込まれるdouble値
 o writeBytes
  public final void writeBytes(String s) throws IOException
Stringをバイト列として書き込む。
パラメータ:
s - 書き込まれるバイトのString
 o writeChars
  public final void writeChars(String s) throws IOException
Stringを文字列として書き込む。
パラメータ:
s - 書き込まれるcharのString
 o writeUTF
  public final void writeUTF(String str) throws IOException
StringをUTF 形式で書き込む。
パラメータ:
str - UTF形式のString
 o size
  public final int size()
書き込まれたバイト数を返す。
返り値:
それまでに書き込まれたバイト数。

全パッケージ  クラス階層  このパッケージ  前項目  次項目  インデックス

本マニュアルに関する著作権および商標