public override void Write(byte[] buffer, int offset, int count) { if (offset == 0 && count == buffer.Length) { file.StoreBuffer(buffer); } else { // We need a temporary copy byte[] copy = new byte[count]; Array.Copy(buffer, offset, copy, 0, count); file.StoreBuffer(copy); } }