mirror of
https://github.com/adamhathcock/sharpcompress.git
synced 2026-09-22 15:04:43 +00:00
fmt
This commit is contained in:
@@ -10,7 +10,6 @@ namespace SharpCompress.Common;
|
||||
|
||||
public partial class EntryStream : Stream, IStreamStack
|
||||
{
|
||||
|
||||
Stream IStreamStack.BaseStream() => _stream;
|
||||
|
||||
private readonly IReader _reader;
|
||||
|
||||
@@ -116,7 +116,9 @@ public abstract class RarVolume : Volume
|
||||
if (fh.FileName == "CMT")
|
||||
{
|
||||
var buffer = new byte[fh.CompressedSize];
|
||||
await fh.PackedStream.NotNull().ReadFullyAsync(buffer, cancellationToken);
|
||||
await fh
|
||||
.PackedStream.NotNull()
|
||||
.ReadFullyAsync(buffer, cancellationToken);
|
||||
Comment = Encoding.UTF8.GetString(buffer, 0, buffer.Length - 1);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,10 +8,8 @@ using SharpCompress.IO;
|
||||
|
||||
public partial class ArcLzwStream : Stream, IStreamStack
|
||||
{
|
||||
|
||||
Stream IStreamStack.BaseStream() => _stream;
|
||||
|
||||
|
||||
private Stream _stream;
|
||||
private bool _processed;
|
||||
private bool _useCrunched;
|
||||
|
||||
@@ -8,7 +8,6 @@ namespace SharpCompress.Compressors.LZMA.Utilites;
|
||||
|
||||
internal partial class CrcBuilderStream : Stream, IStreamStack
|
||||
{
|
||||
|
||||
Stream IStreamStack.BaseStream() => _mTarget;
|
||||
|
||||
private readonly Stream _mTarget;
|
||||
|
||||
@@ -13,7 +13,6 @@ namespace SharpCompress.Compressors.PPMd;
|
||||
|
||||
public class PpmdStream : Stream, IStreamStack
|
||||
{
|
||||
|
||||
Stream IStreamStack.BaseStream() => _stream;
|
||||
|
||||
private readonly PpmdProperties _properties;
|
||||
|
||||
@@ -7,7 +7,6 @@ namespace SharpCompress.Compressors.Shrink;
|
||||
|
||||
internal partial class ShrinkStream : Stream, IStreamStack
|
||||
{
|
||||
|
||||
Stream IStreamStack.BaseStream() => inStream;
|
||||
|
||||
private Stream inStream;
|
||||
|
||||
@@ -41,8 +41,7 @@ internal class CountingStream : Stream
|
||||
public override int Read(byte[] buffer, int offset, int count) =>
|
||||
_stream.Read(buffer, offset, count);
|
||||
|
||||
public override long Seek(long offset, SeekOrigin origin) =>
|
||||
_stream.Seek(offset, origin);
|
||||
public override long Seek(long offset, SeekOrigin origin) => _stream.Seek(offset, origin);
|
||||
|
||||
public override void SetLength(long value) => _stream.SetLength(value);
|
||||
|
||||
|
||||
@@ -10,11 +10,9 @@ namespace SharpCompress.IO
|
||||
{
|
||||
public interface IStreamStack
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// Returns the immediate underlying stream in the stack.
|
||||
/// </summary>
|
||||
Stream BaseStream();
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -216,9 +216,11 @@ internal class NonDisposingStream : Stream, IStreamStack
|
||||
}
|
||||
|
||||
public int DefaultBufferSize { get; set; }
|
||||
|
||||
public Stream BaseStream() => _stream;
|
||||
|
||||
public int BufferSize { get; set; }
|
||||
public int BufferPosition { get; set; }
|
||||
|
||||
public void SetPosition(long position) => throw new NotImplementedException();
|
||||
}
|
||||
|
||||
@@ -23,7 +23,7 @@ internal partial class ReadOnlySubStream : Stream, IStreamStack
|
||||
{
|
||||
_stream = stream ?? throw new ArgumentNullException(nameof(stream));
|
||||
_leaveOpen = leaveOpen;
|
||||
|
||||
|
||||
if (origin != null && stream.Position != origin.Value)
|
||||
{
|
||||
stream.Position = origin.Value;
|
||||
|
||||
@@ -43,7 +43,10 @@ public class WriterTests : TestBase
|
||||
|
||||
readerOptions.ArchiveEncoding.Default = encoding ?? Encoding.Default;
|
||||
|
||||
using var reader = ReaderFactory.OpenReader(new NonDisposingStream(stream), readerOptions);
|
||||
using var reader = ReaderFactory.OpenReader(
|
||||
new NonDisposingStream(stream),
|
||||
readerOptions
|
||||
);
|
||||
reader.WriteAllToDirectory(
|
||||
SCRATCH_FILES_PATH,
|
||||
new ExtractionOptions { ExtractFullPath = true }
|
||||
|
||||
Reference in New Issue
Block a user