mirror of
https://github.com/adamhathcock/sharpcompress.git
synced 2026-02-09 21:24:08 +00:00
Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4a7337b223 | ||
|
|
1d8afb817e | ||
|
|
0f06c3d934 | ||
|
|
9d5cb8d119 |
@@ -84,11 +84,11 @@ namespace SharpCompress.IO
|
||||
throw new NotSupportedException();
|
||||
}
|
||||
|
||||
public override long Length => throw new NotSupportedException();
|
||||
public override long Length => stream.Length;
|
||||
|
||||
public override long Position
|
||||
{
|
||||
get { return stream.Position + bufferStream.Position - bufferStream.Length; }
|
||||
get => stream.Position + bufferStream.Position - bufferStream.Length;
|
||||
set
|
||||
{
|
||||
if (!isRewound)
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
<PropertyGroup>
|
||||
<AssemblyTitle>SharpCompress - Pure C# Decompression/Compression</AssemblyTitle>
|
||||
<NeutralLanguage>en-US</NeutralLanguage>
|
||||
<VersionPrefix>0.27.0</VersionPrefix>
|
||||
<AssemblyVersion>0.27.0</AssemblyVersion>
|
||||
<FileVersion>0.27.0</FileVersion>
|
||||
<VersionPrefix>0.27.1</VersionPrefix>
|
||||
<AssemblyVersion>0.27.1</AssemblyVersion>
|
||||
<FileVersion>0.27.1</FileVersion>
|
||||
<Authors>Adam Hathcock</Authors>
|
||||
<TargetFrameworks>netstandard2.0;netstandard2.1;netcoreapp3.1;net5.0</TargetFrameworks>
|
||||
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
|
||||
|
||||
37
tests/SharpCompress.Test/GZip/GZipReaderTests.cs
Normal file
37
tests/SharpCompress.Test/GZip/GZipReaderTests.cs
Normal file
@@ -0,0 +1,37 @@
|
||||
using System.IO;
|
||||
using SharpCompress.Common;
|
||||
using SharpCompress.IO;
|
||||
using Xunit;
|
||||
|
||||
namespace SharpCompress.Test.GZip
|
||||
{
|
||||
public class GZipReaderTests : ReaderTests
|
||||
{
|
||||
public GZipReaderTests()
|
||||
{
|
||||
UseExtensionInsteadOfNameToVerify = true;
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void GZip_Reader_Generic()
|
||||
{
|
||||
Read("Tar.tar.gz", CompressionType.GZip);
|
||||
}
|
||||
|
||||
|
||||
[Fact]
|
||||
public void GZip_Reader_Generic2()
|
||||
{
|
||||
//read only as GZip itme
|
||||
using (Stream stream = File.OpenRead(Path.Combine(TEST_ARCHIVES_PATH, "Tar.tar.gz")))
|
||||
using (var reader = SharpCompress.Readers.GZip.GZipReader.Open(new RewindableStream(stream)))
|
||||
{
|
||||
while (reader.MoveToNextEntry()) // Crash here
|
||||
{
|
||||
Assert.NotEqual(0, reader.Entry.Size);
|
||||
Assert.NotEqual(0, reader.Entry.Crc);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user