0

単一のバイト/文字を読み書きするときに、Java I/O が / を使用intせずにbyte/を使用するのはなぜですか。charストリームとリーダーのメソッドは次のとおりです。

入力ストリーム

abstract  int read() 

出力ストリーム

abstract void write(int b) 

読者

int read() 

ライター

void write(**int** c) 

また、配列にいくつかのバイトまたは文字を読み書きするときに / をbyte使用します。データが 1 バイト/文字の場合はcharなぜですか? /intではないのはなぜですか?bytechar

入力ストリーム

int read(byte[] b)   
int** read(byte[] b, int off, int len)

出力ストリーム

void write(byte[] b)   
void write(byte[] b, int off, int len)

読者

int read(char[] cbuf) 
abstract  int read(char[] cbuf, int off, int len) 

ライター

void write(char[] cbuf) 
abstract  void write(**char**[] cbuf, int off, int len) 
4

0 に答える 0