Click here to Skip to main content
15,848,594 members
Home / Discussions / C#
   

C#

 
AnswerRe: compression Pin
Kevin Marois21-Dec-15 10:28
professionalKevin Marois21-Dec-15 10:28 
GeneralRe: compression Pin
jackie.398121-Dec-15 10:31
jackie.398121-Dec-15 10:31 
GeneralRe: compression Pin
Richard Andrew x6421-Dec-15 11:26
professionalRichard Andrew x6421-Dec-15 11:26 
AnswerRe: compression Pin
Dave Kreskowiak21-Dec-15 12:05
mveDave Kreskowiak21-Dec-15 12:05 
GeneralRe: compression Pin
jackie.398121-Dec-15 12:09
jackie.398121-Dec-15 12:09 
AnswerRe: compression Pin
Rob Philpott21-Dec-15 12:16
Rob Philpott21-Dec-15 12:16 
GeneralRe: compression Pin
jackie.398121-Dec-15 12:19
jackie.398121-Dec-15 12:19 
GeneralRe: compression Pin
Rob Philpott21-Dec-15 12:28
Rob Philpott21-Dec-15 12: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 12:33
jackie.398121-Dec-15 12:33 
GeneralRe: compression Pin
Richard MacCutchan21-Dec-15 21:37
mveRichard MacCutchan21-Dec-15 21:37 
GeneralRe: compression Pin
jackie.398122-Dec-15 4:33
jackie.398122-Dec-15 4:33 
GeneralRe: compression Pin
Richard MacCutchan22-Dec-15 4:34
mveRichard MacCutchan22-Dec-15 4:34 
GeneralRe: compression Pin
jackie.398122-Dec-15 5:08
jackie.398122-Dec-15 5:08 
GeneralRe: compression Pin
Richard MacCutchan22-Dec-15 8:01
mveRichard MacCutchan22-Dec-15 8:01 
GeneralRe: compression Pin
jackie.398122-Dec-15 8:38
jackie.398122-Dec-15 8:38 
GeneralRe: compression Pin
Richard MacCutchan22-Dec-15 8:46
mveRichard MacCutchan22-Dec-15 8:46 
GeneralRe: compression Pin
jackie.398122-Dec-15 8:57
jackie.398122-Dec-15 8:57 
GeneralRe: compression Pin
Richard MacCutchan22-Dec-15 22:32
mveRichard MacCutchan22-Dec-15 22:32 
GeneralRe: compression Pin
jackie.398124-Dec-15 8:20
jackie.398124-Dec-15 8:20 
GeneralRe: compression Pin
Mycroft Holmes22-Dec-15 12:57
professionalMycroft Holmes22-Dec-15 12:57 
Questionhow can i use delegate to output several param in multi-thread? Pin
smallkubi21-Dec-15 4:29
smallkubi21-Dec-15 4:29 
AnswerRe: how can i use delegate to output several param in multi-thread? Pin
OriginalGriff21-Dec-15 4:53
mveOriginalGriff21-Dec-15 4:53 
GeneralRe: how can i use delegate to output several param in multi-thread? Pin
smallkubi21-Dec-15 5:44
smallkubi21-Dec-15 5:44 
AnswerRe: how can i use delegate to output several param in multi-thread? Pin
Eddy Vluggen21-Dec-15 7:32
professionalEddy Vluggen21-Dec-15 7:32 
GeneralRe: how can i use delegate to output several param in multi-thread? Pin
smallkubi21-Dec-15 16:13
smallkubi21-Dec-15 16: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.