Remove BOM from .cs files

This commit is contained in:
Alexander Luzgarev 2025-04-14 20:22:48 +02:00
parent 003186b3b1
commit c8acc1f93d
58 changed files with 149 additions and 149 deletions

View File

@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Generic;
using System.Numerics;
using Xunit;

View File

@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;

View File

@ -1,4 +1,4 @@
namespace MatFileHandler.Tests
namespace MatFileHandler.Tests
{
/// <summary>
/// Data used in reading/writing tests.

View File

@ -1,4 +1,4 @@
using Xunit;
using Xunit;
namespace MatFileHandler.Tests
{

View File

@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;

View File

@ -1,4 +1,4 @@
namespace MatFileHandler.Tests;
namespace MatFileHandler.Tests;
/// <summary>
/// Method of reading .mat files for testing.

View File

@ -1,4 +1,4 @@
using System;
using System;
using System.IO;
using System.Numerics;
using Xunit;

View File

@ -1,4 +1,4 @@
namespace MatFileHandler.Tests;
namespace MatFileHandler.Tests;
/// <summary>
/// Method of writing .mat files for testing.

View File

@ -1,4 +1,4 @@
using System;
using System;
using System.IO;
namespace MatFileHandler.Tests

View File

@ -1,4 +1,4 @@
using System;
using System;
using System.IO;
namespace MatFileHandler.Tests

View File

@ -1,4 +1,4 @@
using System;
using System;
namespace MatFileHandler
{

View File

@ -1,92 +1,92 @@
using System;
using System.IO;
namespace MatFileHandler
{
/// <summary>
/// A stream that calculates Adler32 checksum of everything
/// written to it before passing to another stream.
/// </summary>
internal class ChecksumCalculatingStream : Stream
{
private const uint BigPrime = 0xFFF1;
private readonly Stream _stream;
private uint s1;
private uint s2;
/// <summary>
/// Initializes a new instance of the <see cref="ChecksumCalculatingStream"/> class.
/// </summary>
/// <param name="stream">Wrapped stream.</param>
public ChecksumCalculatingStream(Stream stream)
{
_stream = stream;
s1 = 1;
s2 = 0;
}
/// <inheritdoc />
public override bool CanRead => false;
/// <inheritdoc />
public override bool CanSeek => false;
/// <inheritdoc />
public override bool CanWrite => true;
/// <inheritdoc />
public override long Length => throw new NotImplementedException();
/// <inheritdoc />
public override long Position
{
get => throw new NotImplementedException();
set => throw new NotImplementedException();
}
/// <inheritdoc />
public override void Flush()
{
_stream.Flush();
}
/// <inheritdoc />
public override int Read(byte[] buffer, int offset, int count)
{
throw new NotImplementedException();
}
/// <inheritdoc />
public override long Seek(long offset, SeekOrigin origin)
{
throw new NotImplementedException();
}
/// <inheritdoc />
public override void SetLength(long value)
{
throw new NotImplementedException();
}
/// <inheritdoc />
public override void Write(byte[] buffer, int offset, int count)
{
for (var i = offset; i < offset + count; i++)
{
s1 = (s1 + buffer[i]) % BigPrime;
s2 = (s2 + s1) % BigPrime;
}
_stream.Write(buffer, offset, count);
}
/// <summary>
/// Calculate the checksum of everything written to the stream so far.
/// </summary>
/// <returns>Checksum of everything written to the stream so far.</returns>
public uint GetCrc()
{
return (s2 << 16) | s1;
}
}
}
using System;
using System.IO;
namespace MatFileHandler
{
/// <summary>
/// A stream that calculates Adler32 checksum of everything
/// written to it before passing to another stream.
/// </summary>
internal class ChecksumCalculatingStream : Stream
{
private const uint BigPrime = 0xFFF1;
private readonly Stream _stream;
private uint s1;
private uint s2;
/// <summary>
/// Initializes a new instance of the <see cref="ChecksumCalculatingStream"/> class.
/// </summary>
/// <param name="stream">Wrapped stream.</param>
public ChecksumCalculatingStream(Stream stream)
{
_stream = stream;
s1 = 1;
s2 = 0;
}
/// <inheritdoc />
public override bool CanRead => false;
/// <inheritdoc />
public override bool CanSeek => false;
/// <inheritdoc />
public override bool CanWrite => true;
/// <inheritdoc />
public override long Length => throw new NotImplementedException();
/// <inheritdoc />
public override long Position
{
get => throw new NotImplementedException();
set => throw new NotImplementedException();
}
/// <inheritdoc />
public override void Flush()
{
_stream.Flush();
}
/// <inheritdoc />
public override int Read(byte[] buffer, int offset, int count)
{
throw new NotImplementedException();
}
/// <inheritdoc />
public override long Seek(long offset, SeekOrigin origin)
{
throw new NotImplementedException();
}
/// <inheritdoc />
public override void SetLength(long value)
{
throw new NotImplementedException();
}
/// <inheritdoc />
public override void Write(byte[] buffer, int offset, int count)
{
for (var i = offset; i < offset + count; i++)
{
s1 = (s1 + buffer[i]) % BigPrime;
s2 = (s2 + s1) % BigPrime;
}
_stream.Write(buffer, offset, count);
}
/// <summary>
/// Calculate the checksum of everything written to the stream so far.
/// </summary>
/// <returns>Checksum of everything written to the stream so far.</returns>
public uint GetCrc()
{
return (s2 << 16) | s1;
}
}
}

View File

@ -1,4 +1,4 @@
using System;
using System;
namespace MatFileHandler
{

View File

@ -1,4 +1,4 @@
namespace MatFileHandler
namespace MatFileHandler
{
/// <summary>
/// Describes compression usage strategy for writing files.

View File

@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Numerics;

View File

@ -1,4 +1,4 @@
namespace MatFileHandler
namespace MatFileHandler
{
/// <summary>
/// Base class for all data elements in .mat files.

View File

@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Numerics;

View File

@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Generic;
using System.IO;
using System.IO.Compression;

View File

@ -1,4 +1,4 @@
using System;
using System;
namespace MatFileHandler
{

View File

@ -1,4 +1,4 @@
using System;
using System;
namespace MatFileHandler
{

View File

@ -1,4 +1,4 @@
using System;
using System;
using System.Linq;
using System.Numerics;

View File

@ -1,4 +1,4 @@
using System;
using System;
using System.Linq;
namespace MatFileHandler

View File

@ -1,4 +1,4 @@
using System;
using System;
namespace MatFileHandler
{

View File

@ -1,4 +1,4 @@
namespace MatFileHandler
namespace MatFileHandler
{
/// <summary>
/// A better interface for using enum adapter.

View File

@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Numerics;

View File

@ -1,4 +1,4 @@
using System;
using System;
namespace MatFileHandler
{

View File

@ -1,4 +1,4 @@
using System;
using System;
using System.Globalization;
using System.IO;
using System.Linq;

View File

@ -1,4 +1,4 @@
using System;
using System;
using System.Numerics;
namespace MatFileHandler

View File

@ -1,4 +1,4 @@
namespace MatFileHandler
namespace MatFileHandler
{
/// <summary>
/// An interface providing access to array's contents.

View File

@ -1,4 +1,4 @@
namespace MatFileHandler
namespace MatFileHandler
{
/// <summary>
/// Matlab's cell array.

View File

@ -1,4 +1,4 @@
namespace MatFileHandler
namespace MatFileHandler
{
/// <summary>
/// Matlab's character array.

View File

@ -1,4 +1,4 @@
namespace MatFileHandler
namespace MatFileHandler
{
/// <summary>
/// An interface for accessing the contents of .mat files.

View File

@ -1,4 +1,4 @@
using System.Collections.Generic;
using System.Collections.Generic;
namespace MatFileHandler
{

View File

@ -1,4 +1,4 @@
using System.Collections.Generic;
using System.Collections.Generic;
namespace MatFileHandler
{

View File

@ -1,4 +1,4 @@
using System.Collections.Generic;
using System.Collections.Generic;
namespace MatFileHandler
{

View File

@ -1,4 +1,4 @@
namespace MatFileHandler
namespace MatFileHandler
{
/// <summary>
/// An interface for accessing the variable contents.

View File

@ -1,4 +1,4 @@
using System;
using System;
using System.Numerics;
namespace MatFileHandler

View File

@ -1,4 +1,4 @@
using System.Collections.Generic;
using System.Collections.Generic;
using System.Linq;
namespace MatFileHandler

View File

@ -1,4 +1,4 @@
namespace MatFileHandler
namespace MatFileHandler
{
/// <summary>
/// Character array.

View File

@ -1,4 +1,4 @@
using System.Collections.Generic;
using System.Collections.Generic;
using System.Linq;
namespace MatFileHandler

View File

@ -1,4 +1,4 @@
using System.Collections.Generic;
using System.Collections.Generic;
using System.IO;
namespace MatFileHandler

View File

@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Generic;
using System.IO;
using System.IO.Compression;

View File

@ -1,4 +1,4 @@
namespace MatFileHandler
namespace MatFileHandler
{
/// <summary>
/// Options for writing .mat files.

View File

@ -1,4 +1,4 @@
using System;
using System;
using System.Numerics;
namespace MatFileHandler

View File

@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Numerics;

View File

@ -1,4 +1,4 @@
using System;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;

View File

@ -1,4 +1,4 @@
namespace MatFileHandler
namespace MatFileHandler
{
/// <inheritdoc />
internal class MatVariable : IVariable

View File

@ -1,4 +1,4 @@
namespace MatFileHandler
namespace MatFileHandler
{
/// <summary>
/// A matrix of type T.

View File

@ -1,4 +1,4 @@
using System;
using System;
using System.Numerics;
namespace MatFileHandler

View File

@ -1,4 +1,4 @@
using System;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;

View File

@ -1,4 +1,4 @@
using System;
using System;
using System.IO;
namespace MatFileHandler;

View File

@ -1,4 +1,4 @@
using System;
using System;
namespace MatFileHandler
{

View File

@ -1,4 +1,4 @@
using System;
using System;
using System.Text;
namespace MatFileHandler

View File

@ -1,4 +1,4 @@
using System;
using System;
using System.IO;
namespace MatFileHandler

View File

@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Generic;
namespace MatFileHandler

View File

@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;

View File

@ -1,4 +1,4 @@
using System;
using System;
using System.Linq;
namespace MatFileHandler

View File

@ -1,4 +1,4 @@
namespace MatFileHandler
namespace MatFileHandler
{
/// <summary>
/// Type of the data attached to the tag.