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.Collections.Generic;
using System.Numerics; using System.Numerics;
using Xunit; using Xunit;

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -1,4 +1,4 @@
namespace MatFileHandler namespace MatFileHandler
{ {
/// <summary> /// <summary>
/// Base class for all data elements in .mat files. /// 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.Collections.Generic;
using System.Linq; using System.Linq;
using System.Numerics; using System.Numerics;

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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