ASF Bugzilla – Attachment 20478 Details for
Bug 42834
RawDataBlock makes incorrect assumption about size of data returned by IOUtils.readFully()
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
patch
poi.patch (text/plain), 1.32 KB, created by
Paul King
on 2007-07-08 07:58:31 UTC
(
hide
)
Description:
patch
Filename:
MIME Type:
Creator:
Paul King
Created:
2007-07-08 07:58:31 UTC
Size:
1.32 KB
patch
obsolete
>--- RawDataBlock.java 2007-01-01 13:39:36.000000000 +1000 >+++ Copy of RawDataBlock.java 2007-07-09 00:40:39.031250000 +1000 >@@ -15,7 +15,7 @@ > See the License for the specific language governing permissions and > limitations under the License. > ==================================================================== */ >- >+ > > package org.apache.poi.poifs.storage; > >@@ -48,30 +48,9 @@ > public RawDataBlock(final InputStream stream) > throws IOException > { >- _data = new byte[ POIFSConstants.BIG_BLOCK_SIZE ]; >+ _data = new byte[512]; > int count = IOUtils.readFully(stream, _data); >- >- if (count == -1) >- { >- _eof = true; >- } >- else if (count != POIFSConstants.BIG_BLOCK_SIZE) >- { >- if (count == -1) >- //Cant have -1 bytes read in the error message! >- count = 0; >- >- String type = " byte" + ((count == 1) ? ("") >- : ("s")); >- >- throw new IOException("Unable to read entire block; " + count >- + type + " read; expected " >- + POIFSConstants.BIG_BLOCK_SIZE + " bytes"); >- } >- else >- { >- _eof = false; >- } >+ _eof = count == -1; > } > > /**
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 42834
: 20478