Click here to Skip to main content
15,888,461 members
Home / Discussions / C#
   

C#

 
QuestionI want to modify/replace some data from a binary file without loadig the file in memory. Pin
Alex Manolescu30-Dec-09 6:07
Alex Manolescu30-Dec-09 6:07 
AnswerRe: I want to modify/replace some data from a binary file without loadig the file in memory. Pin
ProtoBytes30-Dec-09 6:39
ProtoBytes30-Dec-09 6:39 
GeneralRe: I want to modify/replace some data from a binary file without loadig the file in memory. Pin
Alex Manolescu30-Dec-09 6:56
Alex Manolescu30-Dec-09 6:56 
GeneralRe: I want to modify/replace some data from a binary file without loadig the file in memory. Pin
ProtoBytes30-Dec-09 7:07
ProtoBytes30-Dec-09 7:07 
GeneralRe: I want to modify/replace some data from a binary file without loadig the file in memory. Pin
Alex Manolescu30-Dec-09 8:27
Alex Manolescu30-Dec-09 8:27 
GeneralRe: I want to modify/replace some data from a binary file without loadig the file in memory. Pin
#realJSOP30-Dec-09 7:08
mve#realJSOP30-Dec-09 7:08 
GeneralRe: I want to modify/replace some data from a binary file without loadig the file in memory. Pin
Alex Manolescu30-Dec-09 8:29
Alex Manolescu30-Dec-09 8:29 
AnswerRe: I want to modify/replace some data from a binary file without loadig the file in memory. Pin
Luc Pattyn30-Dec-09 6:49
sitebuilderLuc Pattyn30-Dec-09 6:49 
Hi,

some coding comments:

1. that continue is ugly; what you want is an if (...) ... else ...
2. please drop the flushes, they don't make any sense just before a close.
3. you can replace the close() by using a using construct.

FYI: BinaryWriter.Write(string) "Writes a length-prefixed string to this stream in the current encoding", which may or may not be what you want. And of course, inserting something in the middle of the file may break its format. Don't try it like that with an EXE file!

Smile | :)

Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]

Merry Christmas and a Happy New Year to all.


GeneralRe: I want to modify/replace some data from a binary file without loadig the file in memory. Pin
Alex Manolescu30-Dec-09 7:00
Alex Manolescu30-Dec-09 7:00 
GeneralRe: I want to modify/replace some data from a binary file without loadig the file in memory. Pin
Luc Pattyn30-Dec-09 7:30
sitebuilderLuc Pattyn30-Dec-09 7:30 
GeneralRe: I want to modify/replace some data from a binary file without loadig the file in memory. Pin
Alex Manolescu30-Dec-09 8:25
Alex Manolescu30-Dec-09 8:25 
AnswerRe: I want to modify/replace some data from a binary file without loadig the file in memory. Pin
petercrab30-Dec-09 17:59
petercrab30-Dec-09 17:59 
QuestionAbstracts: can I do better than this? Pin
MollyTheCoder30-Dec-09 4:45
MollyTheCoder30-Dec-09 4:45 
AnswerRe: Abstracts: can I do better than this? Pin
Luc Pattyn30-Dec-09 4:56
sitebuilderLuc Pattyn30-Dec-09 4:56 
GeneralRe: Abstracts: can I do better than this? Pin
MollyTheCoder30-Dec-09 5:22
MollyTheCoder30-Dec-09 5:22 
AnswerRe: Abstracts: can I do better than this? Pin
#realJSOP30-Dec-09 5:14
mve#realJSOP30-Dec-09 5:14 
AnswerRe: Abstracts: can I do better than this? Pin
DaveyM6930-Dec-09 5:20
professionalDaveyM6930-Dec-09 5:20 
AnswerRe: Abstracts: can I do better than this? Pin
Paulo Zemek30-Dec-09 5:23
mvaPaulo Zemek30-Dec-09 5:23 
AnswerRe: Abstracts: can I do better than this? Pin
Eddy Vluggen30-Dec-09 6:56
professionalEddy Vluggen30-Dec-09 6:56 
AnswerRe: Abstracts: can I do better than this? [modified] Pin
PIEBALDconsult30-Dec-09 7:20
mvePIEBALDconsult30-Dec-09 7:20 
GeneralRe: Abstracts: can I do better than this? Pin
MollyTheCoder30-Dec-09 7:43
MollyTheCoder30-Dec-09 7:43 
GeneralRe: Abstracts: can I do better than this? Pin
PIEBALDconsult30-Dec-09 7:52
mvePIEBALDconsult30-Dec-09 7:52 
GeneralRe: Abstracts: can I do better than this? Pin
MollyTheCoder30-Dec-09 7:58
MollyTheCoder30-Dec-09 7:58 
GeneralRe: Abstracts: can I do better than this? Pin
pbalaga30-Dec-09 8:12
pbalaga30-Dec-09 8:12 
GeneralRe: Abstracts: can I do better than this? [modified] Pin
ProtoBytes30-Dec-09 8:35
ProtoBytes30-Dec-09 8:35 

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.