Click here to Skip to main content
15,887,328 members
Home / Discussions / C#
   

C#

 
AnswerRe: compression Pin
Kevin Marois21-Dec-15 9:28
professionalKevin Marois21-Dec-15 9:28 
GeneralRe: compression Pin
jackie.398121-Dec-15 9:31
jackie.398121-Dec-15 9:31 
GeneralRe: compression Pin
Richard Andrew x6421-Dec-15 10:26
professionalRichard Andrew x6421-Dec-15 10:26 
AnswerRe: compression Pin
Dave Kreskowiak21-Dec-15 11:05
mveDave Kreskowiak21-Dec-15 11:05 
GeneralRe: compression Pin
jackie.398121-Dec-15 11:09
jackie.398121-Dec-15 11:09 
AnswerRe: compression Pin
Rob Philpott21-Dec-15 11:16
Rob Philpott21-Dec-15 11:16 
GeneralRe: compression Pin
jackie.398121-Dec-15 11:19
jackie.398121-Dec-15 11:19 
GeneralRe: compression Pin
Rob Philpott21-Dec-15 11:28
Rob Philpott21-Dec-15 11:28 
Hmm. OK, on the assumption that you are compressing one file, and that the separate chunk files are not expected to interop with things like WinZip or WinRar it would be fairly straight forward.
  1. Open the source file with a FileStream
  2. Chain a DeflateStream onto the filestream (just pass in constructor)
  3. Read from the deflate stream the number of bytes you want in your chunks (into byte array)
  4. Write entire byte array to individual file.
  5. Goto 3 (until end of filestream).
Going the other way is a bit more tricky, as you can't really create one stream from a set of files, but works in a similar fashion.
Regards,
Rob Philpott.

GeneralRe: compression Pin
jackie.398121-Dec-15 11:33
jackie.398121-Dec-15 11:33 
GeneralRe: compression Pin
Richard MacCutchan21-Dec-15 20:37
mveRichard MacCutchan21-Dec-15 20:37 
GeneralRe: compression Pin
jackie.398122-Dec-15 3:33
jackie.398122-Dec-15 3:33 
GeneralRe: compression Pin
Richard MacCutchan22-Dec-15 3:34
mveRichard MacCutchan22-Dec-15 3:34 
GeneralRe: compression Pin
jackie.398122-Dec-15 4:08
jackie.398122-Dec-15 4:08 
GeneralRe: compression Pin
Richard MacCutchan22-Dec-15 7:01
mveRichard MacCutchan22-Dec-15 7:01 
GeneralRe: compression Pin
jackie.398122-Dec-15 7:38
jackie.398122-Dec-15 7:38 
GeneralRe: compression Pin
Richard MacCutchan22-Dec-15 7:46
mveRichard MacCutchan22-Dec-15 7:46 
GeneralRe: compression Pin
jackie.398122-Dec-15 7:57
jackie.398122-Dec-15 7:57 
GeneralRe: compression Pin
Richard MacCutchan22-Dec-15 21:32
mveRichard MacCutchan22-Dec-15 21:32 
GeneralRe: compression Pin
jackie.398124-Dec-15 7:20
jackie.398124-Dec-15 7:20 
GeneralRe: compression Pin
Mycroft Holmes22-Dec-15 11:57
professionalMycroft Holmes22-Dec-15 11:57 
Questionhow can i use delegate to output several param in multi-thread? Pin
smallkubi21-Dec-15 3:29
smallkubi21-Dec-15 3:29 
AnswerRe: how can i use delegate to output several param in multi-thread? Pin
OriginalGriff21-Dec-15 3:53
mveOriginalGriff21-Dec-15 3:53 
GeneralRe: how can i use delegate to output several param in multi-thread? Pin
smallkubi21-Dec-15 4:44
smallkubi21-Dec-15 4:44 
AnswerRe: how can i use delegate to output several param in multi-thread? Pin
Eddy Vluggen21-Dec-15 6:32
professionalEddy Vluggen21-Dec-15 6:32 
GeneralRe: how can i use delegate to output several param in multi-thread? Pin
smallkubi21-Dec-15 15:13
smallkubi21-Dec-15 15:13 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.