Click here to Skip to main content
15,889,804 members
Home / Discussions / C#
   

C#

 
GeneralRe: generics question Pin
George_George11-May-08 21:45
George_George11-May-08 21:45 
GeneralRe: generics question Pin
S. Senthil Kumar11-May-08 22:45
S. Senthil Kumar11-May-08 22:45 
GeneralRe: generics question Pin
George_George11-May-08 23:06
George_George11-May-08 23:06 
GeneralRe: generics question Pin
S. Senthil Kumar11-May-08 23:59
S. Senthil Kumar11-May-08 23:59 
GeneralRe: generics question Pin
George_George12-May-08 1:28
George_George12-May-08 1:28 
GeneralRe: generics question Pin
S. Senthil Kumar12-May-08 2:17
S. Senthil Kumar12-May-08 2:17 
GeneralRe: generics question Pin
George_George12-May-08 2:32
George_George12-May-08 2:32 
QuestionFile header processing... [modified] Pin
natsuyaki10-May-08 22:00
natsuyaki10-May-08 22:00 
<br />
Name            Size     Value          Desciption<br />
HEADER	       4 bytes	0x04036b2e 	Mark this file as readable<br />
FILE_LEN       4 bytes	Int32	         Mark the length of FILE block<br />
FILE	       runtime	byte[]	         The file's original name<br />
HASH	       16 bytes	byte[]	         Hash code of the data(header excluded)<br />


This is a simple header of a compressed file I'm developing. Each time a file is required to be processed, the program will firstly check the

header. If passed, compress the file and add header to it. The problem is, I have to firstly read the source file and create the output file,

and then compress it by using a third party method(the method will automatically close the input and output stream Dead | X| ), then open the output

file again, read it out to a buffer, write the header, and finally write the data in the buffer to the output file.

It's very inefficientUnsure | :~ . Is there any more efficient way to do this?

Thanks in advance...

modified on Sunday, May 11, 2008 4:52 AM

AnswerRe: File header processing... Pin
DanB198310-May-08 23:14
DanB198310-May-08 23:14 
GeneralRe: File header processing... Pin
natsuyaki10-May-08 23:34
natsuyaki10-May-08 23:34 
GeneralRe: File header processing... Pin
DanB198310-May-08 23:52
DanB198310-May-08 23:52 
GeneralRe: File header processing... Pin
natsuyaki10-May-08 23:59
natsuyaki10-May-08 23:59 
AnswerRe: File header processing... Pin
boblaw9911-May-08 4:13
boblaw9911-May-08 4:13 
GeneralRe: File header processing... Pin
natsuyaki11-May-08 4:24
natsuyaki11-May-08 4:24 
AnswerRe: File header processing... Pin
boblaw9911-May-08 5:03
boblaw9911-May-08 5:03 
GeneralRe: File header processing... Pin
natsuyaki11-May-08 5:16
natsuyaki11-May-08 5:16 
AnswerRe: File header processing... Pin
boblaw9911-May-08 5:22
boblaw9911-May-08 5:22 
GeneralRe: File header processing... Pin
natsuyaki11-May-08 5:34
natsuyaki11-May-08 5:34 
Questionmeta data and attribute Pin
George_George10-May-08 21:43
George_George10-May-08 21:43 
AnswerRe: meta data and attribute Pin
natsuyaki10-May-08 22:05
natsuyaki10-May-08 22:05 
GeneralRe: meta data and attribute Pin
George_George10-May-08 22:21
George_George10-May-08 22:21 
GeneralRe: meta data and attribute Pin
natsuyaki10-May-08 22:36
natsuyaki10-May-08 22:36 
GeneralRe: meta data and attribute Pin
George_George10-May-08 22:41
George_George10-May-08 22:41 
GeneralRe: meta data and attribute Pin
natsuyaki10-May-08 22:50
natsuyaki10-May-08 22:50 
GeneralRe: meta data and attribute Pin
George_George10-May-08 22:56
George_George10-May-08 22:56 

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.