| Summary: | XMLSourceFromInputStream trim input data | ||
|---|---|---|---|
| Product: | [Tools] Data Tools | Reporter: | Břetislav Če ník <B.Cernik> |
| Component: | Enablement:ODA | Assignee: | Mingxia Wu <mwu> |
| Status: | NEW --- | QA Contact: | Xiaoying Gu <bluesoldier> |
| Severity: | normal | ||
| Priority: | P3 | CC: | bin.feng, bluesoldier, lchan |
| Version: | 1.8.2 | ||
| Target Milestone: | --- | ||
| Hardware: | PC | ||
| OS: | Windows 7 | ||
| Whiteboard: | |||
The behavior of InputStream.read() is determined by the underlying implementation. There is little information about the InputStream being used for producing the problem. Could you provide more detailed info required for reproduced the problem? In Java API Specification for Inputstream method
public int read(byte[] b)
throws IOException
Reads some number of bytes from the input stream and stores them into the buffer array b. The number of bytes actually read is returned as an integer. This method blocks until input !!! data is available !!!, end of file is detected, or an exception is thrown.
By the API specification one read method doesn't need to read all data of InputStream to EOF.
If no data is available ie. reading from HttpServletRequest.getInputStream() method return control and next data will be available after some time.
|
There are bad implementation of reading data in the class org.eclipse.datatools.enablement.oda.xml.util.XMLSourceFromInputStream.LocalCache on construtor LocalCache( InputStream in ) The constructor read data from InputStream to local memory variable cacheMem but on some platform - Tomcat on windows x64 it doesn't read all data but only first available block/packet. public LocalCache( InputStream in ) throws OdaException { assert in != null; try { memSize = in.read( cacheMem ); // !!! there is bug. It doesn't read data to end of stream or cacheMem.length. // It read only a few first kB from InputStream if ( memSize == MAX_MEMORY_CACHE_SIZE ) { . . . Method read of InputStream class read only available data not all data to end of file. Result is that the xml data are trimmed. I get this trouble in Tomcat 7 x64 Winddows 2008 x64 platform in HttpServlet that call Birt with setting "org.eclipse.datatools.enablement.oda.xml.inputStream" appContext property