View | Details | Raw Unified | Return to bug 44836
Collapse All | Expand All

(-)RawDataBlockList.java (+3 lines)
Lines 53-58 Link Here
53
53
54
            if (block.eof())
54
            if (block.eof())
55
            {
55
            {
56
            	if(block.getData().length>0){
57
                    blocks.add(block);            		
58
            	}
56
                break;
59
                break;
57
            }
60
            }
58
            blocks.add(block);
61
            blocks.add(block);
(-)RawDataBlock.java (-10 / +2 lines)
Lines 55-63 Link Here
55
     * @param stream the InputStream from which the data will be read
55
     * @param stream the InputStream from which the data will be read
56
     * @param blockSize the size of the POIFS blocks, normally 512 bytes {@link POIFSConstants#BIG_BLOCK_SIZE}
56
     * @param blockSize the size of the POIFS blocks, normally 512 bytes {@link POIFSConstants#BIG_BLOCK_SIZE}
57
     *
57
     *
58
     * @exception IOException on I/O errors, and if an insufficient
58
     * @exception IOException on I/O errors
59
     *            amount of data is read (the InputStream must
60
     *            be an exact multiple of the block size)
61
     */
59
     */
62
    public RawDataBlock(final InputStream stream, int blockSize)
60
    public RawDataBlock(final InputStream stream, int blockSize)
63
    		throws IOException {
61
    		throws IOException {
Lines 72-83 Link Here
72
        	//  requested number of bytes, unless it hits
70
        	//  requested number of bytes, unless it hits
73
        	//  an EOF
71
        	//  an EOF
74
            _eof = true;
72
            _eof = true;
75
            String type = " byte" + ((count == 1) ? ("")
76
                                                  : ("s"));
77
78
            throw new IOException("Unable to read entire block; " + count
79
                                  + type + " read before EOF; expected "
80
                                  + blockSize + " bytes");
81
        }
73
        }
82
        else {
74
        else {
83
            _eof = false;
75
            _eof = false;
Lines 110-116 Link Here
110
    public byte [] getData()
102
    public byte [] getData()
111
        throws IOException
103
        throws IOException
112
    {
104
    {
113
        if (eof())
105
        if (eof() && _data.length<=0)
114
        {
106
        {
115
            throw new IOException("Cannot return empty data");
107
            throw new IOException("Cannot return empty data");
116
        }
108
        }

Return to bug 44836