Giter Club home page Giter Club logo

Comments (5)

LexaGV avatar LexaGV commented on June 27, 2024 1

Cool, you're right! For me it was also surprise that file is zero. No problem, my fault. :) Thanks for help!

from easycompressor.

mjebrahimi avatar mjebrahimi commented on June 27, 2024

Hi @LexaGV,
No, it has nothing to do with .NET 4.8 and Nobody has said that .NET 4.8 is obsolete ;) (even Microsoft itself)
This package uses Brotli.NET as underlying, and as you can see from its Github repository it's discontinued and it will no longer be developed and maintained. (more than 3 years ago)
So I also decided not to develop and maintain EasyCompressor.BrotliNET anymore.

from easycompressor.

mjebrahimi avatar mjebrahimi commented on June 27, 2024
  1. Untile now EasyCompressor.BrotliNET (v2.0.2) code base is the same as main line.
  2. EasyCompressor.BrotliNET depends on these two packages:
    Brotli.NET (>= 2.1.1) - (Github)
    EasyCompressor (>= 2.0.2)

from easycompressor.

LexaGV avatar LexaGV commented on June 27, 2024

Thanks, Mohammad! Only now got full pic - Brotli.NET is needed (not explained in ReadMe). But after I assembled full app (including native lib brolib_x64.dll), I got even worse result:

System.AggregateException: One or more errors occurred. ---> System.ArgumentException: Argument bytes must be not empty.
Parameter name: bytes
   at EasyCompressor.Guard.ThrowIfNullOrEmpty[T](IEnumerable`1 enumerable, String paramName) in /_/src/EasyCompressor/Utilities/Guard.cs:line 68
   at EasyCompressor.BaseCompressor.Compress(Byte[] bytes) in /_/src/EasyCompressor/Compressors/Base/BaseCompressor.cs:line 72

I guess this error happen even before running into Brotli.NET. Can you please look at it? I try to use Brotli compressor (as one of the fastest), but fail so far. :(

My demo code is simple:

var compressor = BrotliNETCompressor.Shared;
Parallel.ForEach(... on each file in folder...)
{
    smth = compressor.Compress(data);// data is byte[]
}

BrotliNETCompressor.Shared declared as thread safe, but... can I use one instance for all threads?! (theoretically I should!)

from easycompressor.

mjebrahimi avatar mjebrahimi commented on June 27, 2024

Yes, the Shared instance is thread-safe and you can use this among all your threads.
About the error, as it explains your byte array is empty, I guess one of your files is empty. (size of zero bytes)
Please make sure about it and if the error has remained create a reproducible sample and send it here.

from easycompressor.

Related Issues (9)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.