Click here to Skip to main content
15,891,657 members
Home / Discussions / C#
   

C#

 
GeneralRe: simple memory leak Pin
VJ Reddy20-Apr-12 4:53
VJ Reddy20-Apr-12 4:53 
GeneralRe: simple memory leak Pin
Vipin_Arora20-Apr-12 6:17
Vipin_Arora20-Apr-12 6:17 
QuestionSearch form problem Pin
Amr Mohammed Rashad18-Apr-12 13:39
Amr Mohammed Rashad18-Apr-12 13:39 
AnswerRe: Search form problem Pin
Amr Mohammed Rashad18-Apr-12 18:31
Amr Mohammed Rashad18-Apr-12 18:31 
GeneralRe: Search form problem Pin
phil.o19-Apr-12 0:35
professionalphil.o19-Apr-12 0:35 
Questionconvert large files into byte [] Pin
abbd18-Apr-12 8:27
abbd18-Apr-12 8:27 
AnswerRe: convert large files into byte [] Pin
jschell18-Apr-12 8:53
jschell18-Apr-12 8:53 
AnswerRe: convert large files into byte [] Pin
OriginalGriff18-Apr-12 9:22
mveOriginalGriff18-Apr-12 9:22 
As previously stated, streaming is probably the only way, unless you want to manually read chunks of the file.

.NET has a limit on the maximum size of any one object of 2GB - so no string or array of bytes can exceed this. If you want to read a file bigger than this limit, you have to work in chunks, you cannot read it into any single object in it's entirety.

It should be possible to declare an array like type that provides this chunking, and hides the stream or whatever from the main code. In fact there is an example of this on MSDN: http://msdn.microsoft.com/en-us/library/aa288465(v=vs.71).aspx[^] although their method does seem somewhat inefficient, and I would probably cache a block of data if I did it. Depends on how random-access your data is!

[edit]Typo: "there" for "their" - OriginalGriff[/edit]
Ideological Purity is no substitute for being able to stick your thumb down a pipe to stop the water

QuestionLambda expression tree building [Solved - I think] Pin
wizardzz18-Apr-12 7:43
wizardzz18-Apr-12 7:43 
QuestionSelecting desktop icon Pin
MitchG92_2418-Apr-12 2:32
MitchG92_2418-Apr-12 2:32 
AnswerRe: Selecting desktop icon Pin
Richard MacCutchan18-Apr-12 3:03
mveRichard MacCutchan18-Apr-12 3:03 
GeneralMessage Removed Pin
18-Apr-12 3:08
MitchG92_2418-Apr-12 3:08 
GeneralRe: Selecting desktop icon Pin
Richard MacCutchan18-Apr-12 3:26
mveRichard MacCutchan18-Apr-12 3:26 
AnswerRe: Selecting desktop icon Pin
Eddy Vluggen18-Apr-12 5:07
professionalEddy Vluggen18-Apr-12 5:07 
AnswerRe: Selecting desktop icon Pin
Richard MacCutchan18-Apr-12 5:13
mveRichard MacCutchan18-Apr-12 5:13 
QuestionHow to update in settings.settings file Pin
NarVish18-Apr-12 2:29
NarVish18-Apr-12 2:29 
AnswerRe: How to update in settings.settings file Pin
Eddy Vluggen18-Apr-12 5:03
professionalEddy Vluggen18-Apr-12 5:03 
GeneralRe: How to update in settings.settings file Pin
NarVish18-Apr-12 20:15
NarVish18-Apr-12 20:15 
AnswerRe: How to update in settings.settings file Pin
Eddy Vluggen19-Apr-12 0:23
professionalEddy Vluggen19-Apr-12 0:23 
GeneralRe: How to update in settings.settings file Pin
NarVish19-Apr-12 0:37
NarVish19-Apr-12 0:37 
AnswerRe: How to update in settings.settings file Pin
Eddy Vluggen19-Apr-12 0:53
professionalEddy Vluggen19-Apr-12 0:53 
GeneralRe: How to update in settings.settings file Pin
NarVish19-Apr-12 1:15
NarVish19-Apr-12 1:15 
GeneralRe: How to update in settings.settings file Pin
Eddy Vluggen19-Apr-12 7:03
professionalEddy Vluggen19-Apr-12 7:03 
Generaladd service Pin
Jimmy Darji18-Apr-12 1:00
professionalJimmy Darji18-Apr-12 1:00 
GeneralRe: add service Pin
RobCroll18-Apr-12 1:34
RobCroll18-Apr-12 1:34 

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.