![]() | |
![]() |
| | Thread Tools | Search this Thread | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
#3
| |||
| |||
|
|
zipStream->read(fileBytes); or zipStream->read(fileBytes, 0, fileBytes->Length); then reading stops after 500ish bytes (the number varies for different files but remains the same for the same file attempted multiple times), but if I use: for (int j = 0; j < fileBytes->Length; j++) { fileBytes[j] = zipStream->read(); } then the whole file gets read fine. |
#4
| |||
| |||
|
|
zipStream->read(fileBytes); or zipStream->read(fileBytes, 0, fileBytes->Length); then reading stops after 500ish bytes (the number varies for different files but remains the same for the same file attempted multiple times), but if I use: for (int j = 0; j < fileBytes->Length; j++) { fileBytes[j] = zipStream->read(); } then the whole file gets read fine. I think the last param of "read" is the MAX buffer size you pass to the "read" method, it doesn't mean it should read that much data. So you do have to call read many times (see if it returns some value saying how much bytes it read and then see how much you have to still read to get the file) I haven't used Java's I/O stuff for some time now, but I think the COMM API was behaving like that ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ George Birbilis <birbilis (AT) kagi (DOT) com Microsoft MVP J# for 2004, 2005 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + QuickTime controls (Delphi & ActiveX: VB, PowerPoint, .NET) + Plugs (InterProcess/Internet communication) + TranXform (VB6 form to ASP.net WebForm convertion) http://www.kagi.com/birbilis + Robotics http://www.mech.upatras.gr/~robgroup .................................................. ...................... |
#5
| |||
| |||
|
|
What situations exist in which reading less than the requested maximum is advantageous? "George Birbilis [MVP J#] [9880]" <birbilis (AT) kagi (DOT) com> wrote in message news:eg1hOR2NFHA.3296 (AT) TK2MSFTNGP15 (DOT) phx.gbl... zipStream->read(fileBytes); or zipStream->read(fileBytes, 0, fileBytes->Length); then reading stops after 500ish bytes (the number varies for different files but remains the same for the same file attempted multiple times), but if I use: for (int j = 0; j < fileBytes->Length; j++) { fileBytes[j] = zipStream->read(); } then the whole file gets read fine. I think the last param of "read" is the MAX buffer size you pass to the "read" method, it doesn't mean it should read that much data. So you do have to call read many times (see if it returns some value saying how much bytes it read and then see how much you have to still read to get the file) I haven't used Java's I/O stuff for some time now, but I think the COMM API was behaving like that ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ George Birbilis <birbilis (AT) kagi (DOT) com Microsoft MVP J# for 2004, 2005 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + QuickTime controls (Delphi & ActiveX: VB, PowerPoint, .NET) + Plugs (InterProcess/Internet communication) + TranXform (VB6 form to ASP.net WebForm convertion) http://www.kagi.com/birbilis + Robotics http://www.mech.upatras.gr/~robgroup .................................................. ...................... |
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
| |