19 using Lucene.Net.Support;
20 using CRC32 = Lucene.Net.Support.CRC32;
22 namespace Lucene.Net.Store
33 private bool isDisposed;
41 public override void WriteByte(byte b)
47 public override void WriteBytes(byte[] b,
int offset,
int length)
49 digest.Update(b, offset, length);
50 main.WriteBytes(b, offset, length);
53 public virtual long Checksum
55 get {
return digest.Value; }
58 public override void Flush()
63 protected override void Dispose(
bool disposing)
65 if (isDisposed)
return;
75 public override long FilePointer
77 get {
return main.FilePointer; }
80 public override void Seek(
long pos)
82 throw new System.SystemException(
"not allowed");
90 public virtual void PrepareCommit()
92 long checksum = Checksum;
98 long pos = main.FilePointer;
99 main.WriteLong(checksum - 1);
105 public virtual void FinishCommit()
107 main.WriteLong(Checksum);
110 public override long Length
112 get {
return main.Length; }