从流 myfilesize 中读入 sizeof(MyFileSize)个字节的数据。
也就是说 myfilesize 必定是个流,
sizeof(MyFileSize)取得此流数据量的大小

解决方案 »

  1.   

    MyFileSize要取得的大小?
    sizeof(MyFileSize)是实质大小?不是很懂。
      

  2.   

    MyFileSize:integer
    谁能帮我呀他们相减是什么啊!!!!
    谢了!!!
      

  3.   

    对!!!
    从流 myfilesize中读入 sizeof(MyFileSize)个字节的数据。
    myfilesize是流,
    sizeof(MyFileSize)取得此流数据量的大小 
      

  4.   

    不会吧,那myfilesize-sizeof(myfilesize)是什么呢!!!
      

  5.   

    -------------------------------------------------------------------------
    Reads up to Count bytes of data from the resource associated with the handle stream into Buffer.function Read(var Buffer; Count: Longint): Longint; override;DescriptionUse Read to read data from the resource associated with the handle stream when the number of bytes in the file is not known. Read transfers up to Count bytes from the resource, starting at the current position, and then advances the current position in the resource by the number of bytes actually transferred. Read returns the number of bytes actually transferred, which may be less than Count if the end of file er is encountered.All other data-reading methods of a handle stream (ReadBuffer, ReadComponent) call Read to do the actual reading.
    ------------------------------------------------------------------------------
    所以 len:=Source.ReadBuffer(MyBuffer,sizeof(MyBuffer));的意思就是
    试图从文件流Source中读sizeof(MyBuffer)字节数据放到缓冲区MyBuffer中,并且返回真正
    读的字节数(保存于变量len中)
    -----------------------------------------------------------------------------
    所以Source.ReadBuffer(MyFileSize,sizeof(MyFileSize));的意思就是
    试图从文件流Source中读sizeof(MyFileSize)字节数据放到缓冲区MyFileSize中
    注意:这儿MyFileSize应该是一个整形变量,而一个整形变量本身就是一个大小为sizeof(MyFileSize)字节的缓冲区!function Read(var Buffer; Count: Longint): Longint; Source.ReadBuffer(MyFileSize,sizeof(MyFileSize));//读出资源大小