Java读写单个字节

DataOutputStream的sriteByte方法

  public final void writeByte(int b)throw IOException;

  将int的最不重要字节写入输出流(最不重要字节,Java的int类型占4Bit,32位,取最后的8位,低位字节)

DataInputStream的readUnsignedByte方法

  public final int readUnsignedByte()throws IOException

  从输入流中读取1字节存入int的最不重要字节

运用读写字节的方式,复制文件:

猜你喜欢

转载自www.cnblogs.com/mcmx/p/9134613.html
今日推荐