Changeset 143


Ignore:
Timestamp:
Apr 1, 2007, 2:27:10 PM (18 years ago)
Author:
alloc
Message:
 
Location:
oup/current
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • oup/current/Helper/LevelDB.pas

    r142 r143  
    4545
    4646procedure TForm_LevelDB.CreateLevel(Source, Target: String);
     47const
     48  EmptyBytes: Array[0..31] of Byte = (
     49      0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 );
    4750var
    4851  DatHeader:        THeader;
     
    336339              RawLinks[i].RawAddr := Stream_Sep.Size;
    337340              Stream_sep.CopyFrom(RawFileStream, RawFileStream.Size);
     341              if (Stream_Sep.Size mod 32) > 0 then
     342                Stream_Sep.Write(EmptyBytes[0], 32 - (Stream_Sep.Size mod 32));
    338343            end else begin
    339344              RawLinks[i].RawAddr := Stream_Raw.Size;
    340345              Stream_Raw.CopyFrom(RawFileStream, RawFileStream.Size);
     346              if (Stream_Raw.Size mod 32) > 0 then
     347                Stream_Raw.Write(EmptyBytes[0], 32 - (Stream_Raw.Size mod 32));
    341348            end;
    342349          end else
     
    348355      DatFileStream.Seek(0, soFromBeginning);
    349356      Stream_Body.CopyFrom(DatFileStream, DatFileStream.Size);
     357      if (Stream_Body.Size mod 32) > 0 then
     358        Stream_Body.Write(EmptyBytes[0], 32 - (Stream_Body.Size mod 32));
    350359    end
    351360    else
     
    378387    Stream_Dat.Write(ExtensionsHeader[i], SizeOf(ExtensionsHeader[i]));
    379388
     389  if (Stream_Dat.Size mod 32) > 0 then
     390    Stream_Dat.Write(EmptyBytes[0], 32 - (Stream_Dat.Size mod 32));
     391
    380392  DatHeader.DataSize  := Stream_Body.Size;
    381393  DatHeader.NamesSize := Stream_Names.Size;
     
    384396  Stream_Body.Seek(0, soFromBeginning);
    385397  Stream_Dat.CopyFrom(Stream_Body, Stream_Body.Size);
     398
     399  if (Stream_Dat.Size mod 32) > 0 then
     400    Stream_Dat.Write(EmptyBytes[0], 32 - (Stream_Dat.Size mod 32));
     401
    386402  DatHeader.NamesAddr := Stream_Dat.Size;
    387403  Stream_Names.Seek(0, soFromBeginning);
Note: See TracChangeset for help on using the changeset viewer.