Example #1
0
 public LzStream(string path, bool useCreateFile = true)
 {
     _handle = useCreateFile
         ? CompressionMethods.LzCreateFile(path, out string uncompressedName)
         : CompressionMethods.LzOpenFile(path, out uncompressedName);
     UncompressedName = uncompressedName;
 }
Example #2
0
 public void OpenFile_LongPath()
 {
     // The OpenFile api only supports 128 character paths.
     using (var cleaner = new TestFileCleaner())
     {
         string path = PathGenerator.CreatePathOfLength(cleaner.TempFolder, 160);
         FileHelper.WriteAllBytes(path, CompressedFile1);
         Action action = () => CompressionMethods.LzOpenFile(path);
         action.ShouldThrow <LzException>().And.Error.Should().Be(LzError.BadInHandle);
     }
 }