Click here to Skip to main content
15,905,971 members
Home / Discussions / C#
   

C#

 
GeneralRe: Generic sum Pin
V. Thieme18-Jan-07 23:37
V. Thieme18-Jan-07 23:37 
AnswerRe: Generic sum Pin
Christian Graus18-Jan-07 22:57
protectorChristian Graus18-Jan-07 22:57 
GeneralRe: Generic sum Pin
V. Thieme18-Jan-07 23:36
V. Thieme18-Jan-07 23:36 
QuestionLoading an image as a byte array Pin
Russell Jones18-Jan-07 22:11
Russell Jones18-Jan-07 22:11 
AnswerRe: Loading an image as a byte array Pin
Christian Graus18-Jan-07 22:56
protectorChristian Graus18-Jan-07 22:56 
GeneralRe: Loading an image as a byte array Pin
Russell Jones18-Jan-07 23:01
Russell Jones18-Jan-07 23:01 
AnswerRe: Loading an image as a byte array Pin
Guffa18-Jan-07 22:56
Guffa18-Jan-07 22:56 
AnswerRe: Loading an image as a byte array Pin
Luc Pattyn18-Jan-07 23:03
sitebuilderLuc Pattyn18-Jan-07 23:03 
I think you are right about fs.Read blocking for at least some data

The doc says "Returns the total number of bytes read into the buffer. This might be less than
the number of bytes requested if that number of bytes are not currently available, or zero if
the end of the stream is reached."

So returning zero because nothing is available yet seems not to occur, hence a wait for data.


Whether you can go on with partial data is entirely up to you (do you need all data, or
just enough to figure out the image size, a thumbnail, ...). You may have to take
the return value of fs.Read into account.

If you need to be sure all data is available, but dont want to wait for it, consider
working asynchronously (with BeginRead).

Smile | :)


Luc Pattyn

GeneralRe: Loading an image as a byte array Pin
Russell Jones18-Jan-07 23:02
Russell Jones18-Jan-07 23:02 
GeneralRe: Loading an image as a byte array Pin
Luc Pattyn18-Jan-07 23:10
sitebuilderLuc Pattyn18-Jan-07 23:10 
GeneralRe: Loading an image as a byte array Pin
Russell Jones18-Jan-07 23:39
Russell Jones18-Jan-07 23:39 
GeneralRe: Loading an image as a byte array Pin
Luc Pattyn18-Jan-07 23:46
sitebuilderLuc Pattyn18-Jan-07 23:46 
Generalbug in doc Pin
Luc Pattyn18-Jan-07 23:58
sitebuilderLuc Pattyn18-Jan-07 23:58 
GeneralRe: bug in doc Pin
Russell Jones19-Jan-07 0:32
Russell Jones19-Jan-07 0:32 
QuestionData Transfer to new table Pin
Bulky Fellow18-Jan-07 22:06
Bulky Fellow18-Jan-07 22:06 
AnswerRe: Data Transfer to new table Pin
mihksoft18-Jan-07 22:49
mihksoft18-Jan-07 22:49 
AnswerRe: Data Transfer to new table Pin
Russell Jones18-Jan-07 22:54
Russell Jones18-Jan-07 22:54 
GeneralRe: Data Transfer to new table Pin
Bulky Fellow24-Jan-07 21:35
Bulky Fellow24-Jan-07 21:35 
QuestionBest way of stopping program after caught in catch{} Pin
livez18-Jan-07 21:49
livez18-Jan-07 21:49 
AnswerRe: Best way of stopping program after caught in catch{} Pin
Stefan Troschuetz18-Jan-07 21:57
Stefan Troschuetz18-Jan-07 21:57 
AnswerRe: Best way of stopping program after caught in catch{} Pin
quiteSmart18-Jan-07 21:58
quiteSmart18-Jan-07 21:58 
GeneralRe: Best way of stopping program after caught in catch{} Pin
livez18-Jan-07 22:24
livez18-Jan-07 22:24 
GeneralRe: Best way of stopping program after caught in catch{} Pin
quiteSmart18-Jan-07 22:36
quiteSmart18-Jan-07 22:36 
AnswerRe: Best way of stopping program after caught in catch{} Pin
Russell Jones18-Jan-07 22:33
Russell Jones18-Jan-07 22:33 
AnswerRe: Best way of stopping program after caught in catch{} Pin
Guffa18-Jan-07 22:37
Guffa18-Jan-07 22:37 

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.