//
// FileSink.cs
//
// Copyright (c) František Boháček. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
using System.Text.RegularExpressions;
using NosSmooth.PacketSerializer.Abstractions.Attributes;
namespace Anonymizer.Sinks;
///
/// A sink that supports reading from a file and writing to a file.
///
public class FileSink : IDisposable, IPacketSource, IPacketDestination
{
private readonly FileSinkOptions _options;
private readonly FileStream _sourceStream;
private readonly FileStream _destinationStream;
///
/// Initializes a new instance of the class.
///
/// The source file path.
/// The destination file path.
/// The options.
public FileSink(string sourceFile, string destinationFile, FileSinkOptions options)
{
_options = options;
_sourceStream = File.OpenRead(sourceFile);
_destinationStream = File.OpenWrite(destinationFile);
}
///
public long Cursor { get; private set; }
///
public Task TryGetNextPacketAsync(out PacketInfo packetInfo, CancellationToken ct = default)
{
throw new NotImplementedException();
}
///
public Task WritePacketAsync(string packetString)
{
throw new NotImplementedException();
}
///
public void Dispose()
{
_sourceStream.Dispose();
_destinationStream.Dispose();
}
}