c# - Extracting the contents of a zipped tab delimited file from a byte array -


i've seen answers question posted, nothing struggling with, , i'm having trouble.

basically, using api returns data in byte array so:

byte[] file = api.getzippedreport(blah, blah); 

i'm trying figure out best way spit out contents of tab delimited file in c# can it.

what simplest way data can use without having save file?

in case .net 4.5 application can use newly introduced ziparchive class offers getentry() method:

stream stream = new memorystream(file); // file byte[] ziparchive archive = new ziparchive(stream ) ziparchiveentry entry = archive.getentry("existingfile.txt");  // logic file entry.open()  entry.lastwritetime = datetimeoffset.utcnow.localdatetime; 

see ziparchive class , ziparchive.getentry method. there property on ziparchive called entries contains entries in readonly collection:

public readonlycollection<ziparchiveentry> entries { get; } 

Comments

Popular posts from this blog

linux - xterm copying to CLIPBOARD using copy-selection causes automatic updating of CLIPBOARD upon mouse selection -

c++ - qgraphicsview horizontal scrolling always has a vertical delta -