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

(-)HeaderBlockReaderORIG.java (+16 lines)
Lines 105-110 Link Here
105
    {
105
    {
106
        _data = new byte[ POIFSConstants.BIG_BLOCK_SIZE ];
106
        _data = new byte[ POIFSConstants.BIG_BLOCK_SIZE ];
107
        int byte_count = stream.read(_data);
107
        int byte_count = stream.read(_data);
108
        /// XXX Patch 
109
        // The read() of java.io.InputStream does not guarantee to provide
110
        // the full amount of requested bytes. It is necessary to repeat the reading
111
        // until the full block is read or eof occured. 
112
        // The original source worked fine up to the point of reading Excel-files 
113
        // contained in a ZIP-file.
114
        while (byte_count!=-1 && byte_count < POIFSConstants.BIG_BLOCK_SIZE) {
115
        	int k = stream.read(_data, byte_count, POIFSConstants.BIG_BLOCK_SIZE-byte_count);
116
        	if (k==-1) {
117
        		break;
118
        	} else {
119
        		byte_count += k;
120
        	}
121
        }
122
        /// XXX Patch         
123
        
108
124
109
        if (byte_count != POIFSConstants.BIG_BLOCK_SIZE)
125
        if (byte_count != POIFSConstants.BIG_BLOCK_SIZE)
110
        {
126
        {

Return to bug 24211