dataInput 共15个接口,2个读取方法(一个全读,一个读写指定位置),1个跳过的方法。10个读取基本字节的方法(boolean,byte,short,char,int,long,float,double,两个UnsignedByte,UnsignedShort,不带正负号的)1个读取一行,1个读取utf-8字符串
void readFully(byte b[]) throws IOException;
读取字节byte为待读取数据
void readFully(byte b[], int off, int len) throws IOException;
读取字节byte为待读取数据off为起始位置,len要读取的个数
int skipBytes(int n) throws IOException;
跳过n个字节。返回实际跳过的值
boolean readBoolean() throws IOException;
读取boolean(适用于写的接口writeBoolean)
byte readByte() throws IOException;
读取byte(适用于写的接口writeByte)
int readUnsignedByte() throws IOException;
读取接口返回0-255的值(适用于writerByte,参数0-255的时候)
short readShort() throws IOException;
读取short(适用于写的接口writeShort)
int readUnsignedShort() throws IOException;
同readUnsignedByte(适用于writerShort,参数0-65535的时候)
char readChar() throws IOException;
读取char
int readInt() throws IOException;
读取int
long readLong() throws IOException;
读取long
float readFloat() throws IOException;
读取float
double readDouble() throws IOException;
读取double
String readLine() throws IOException;
读取接下来的一行。结尾输出null
String readUTF() throws IOException;
读取utf-8的字符串
DataOutput包含14个方法1个输入int的8个低字节。2个写入byte[](全写,指定位置写),8个写基本字节的方法(boolean,byte,short,char,int,long,flout,double)3个写入字符串(一个bytes,chars,UTF)
void write(int b) throws IOException;
输入b的8个低节位,忽略24个高节位
void write(byte b[]) throws IOException;
指定位置插入
void write(byte b[], int off, int len) throws IOException;
8个写基本类型
void writeBoolean(boolean v) throws IOException;
void writeByte(int v) throws IOException;
void writeShort(int v) throws IOException;
void writeChar(int v) throws IOException;
void writeInt(int v) throws IOException;
void writeLong(long v) throws IOException;
void writeFloat(float v) throws IOException;
void writeDouble(double v) throws IOException;
3个写string类型
void writeBytes(String s) throws IOException;
void writeChars(String s) throws IOException;
void writeUTF(String s) throws IOException;