不要当它是bit,当它是Byte流就好了。一样的。

解决方案 »

  1.   

    1。你可以使用无类型文件
    2。你可以使用WIN32函数
      

  2.   

    leeyansheng(风妖精)请详细告知
    多谢,多谢
      

  3.   

    Delphi没有C当中的位变量,所以必须至少以字节为单位读写.一个字节可以有8个位,有2种操作方法:1,直接使用逻辑和移位操作;2,使用集合sets.举一个使用集合的例子:
    type
     TMyBit=0..7;
     TMyBits=set of TMyBit;
    ...
    var
     Mybits:TMyBits;
     f:File;
     i:Integer;
    ...
      MyBits:=[];         //b00000000
      i:=0;
      MyBits:=MyBits+[i]; //b00000001
      MyBits:=MyBits+[1];  //b00000011
      MyBits:=MyBits+[7];  //b10000011
      MyBits:=MyBits-[7];  //b00000011
      MyBits:=[0..7];      //b11111111
      AssignFile(f,'c:\test.data');
      Rewrite(f,1);
      BlockWrite(f,MyBits,1);
      CloseFile(f);