ASF Bugzilla – Attachment 8799 Details for
Bug 24211
IOException reading Excel-files included in an ZIP-file
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch of RawDataBlock.java
IOExceptionReadingZIPFile2.txt (text/plain), 1.34 KB, created by
Volker Tirjan
on 2003-10-29 10:11:37 UTC
(
hide
)
Description:
Patch of RawDataBlock.java
Filename:
MIME Type:
Creator:
Volker Tirjan
Created:
2003-10-29 10:11:37 UTC
Size:
1.34 KB
patch
obsolete
>--- RawDataBlockORIG.java Wed Apr 30 07:38:56 2003 >+++ RawDataBlock.java Wed Oct 29 10:44:43 2003 >@@ -85,6 +85,21 @@ > { > _data = new byte[ POIFSConstants.BIG_BLOCK_SIZE ]; > int count = stream.read(_data); >+ /// XXX Patch >+ // The read() of java.io.InputStream does not guarantee to provide >+ // the full amount of requested bytes. It is necessary to repeat the reading >+ // until the full block is read or eof occured. >+ // The original source worked fine up to the point of reading Excel-files >+ // contained in a ZIP-file. >+ while (count!=-1 && count < POIFSConstants.BIG_BLOCK_SIZE) { >+ int k = stream.read(_data, count, POIFSConstants.BIG_BLOCK_SIZE-count); >+ if (k==-1) { >+ break; >+ } else { >+ count += k; >+ } >+ } >+ /// XXX Patch > > if (count == -1) > { >@@ -94,7 +109,7 @@ > { > String type = " byte" + ((count == 1) ? ("") > : ("s")); >- >+ > throw new IOException("Unable to read entire block; " + count > + type + " read; expected " > + POIFSConstants.BIG_BLOCK_SIZE + " bytes");
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 24211
:
8798
| 8799