Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

200
Views
C# .NET Make GZipStream From Part of Another (large) Stream

So I want to decompress some data stored in a file. The solution I am currently using looks roughly like this:

FileStream fileStream = new FileStream([File path or whatever])
BinaryReader brStream = new BinaryReader(fileStream)

brStream.BaseStream.Position = [Address of the data I want]
byte[] relevantBytes = brStream.readBytes([Length of the data I want])

MemoryStream memoryStream = new MemoryStream(relevantBytes)
GZipStream gZipStream = new GZipStream(memoryStream, CompressionMode.Decompress)

But the problem arises when the data I'm compressing/decompressing is large. I don't want all of that in memory. I would prefer to give GZipStream a FileStream with a starting index and length. How can I do that?

over 4 years ago · Santiago Trujillo
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!