ignores result of java.io.InputStream.read(byte[], int, int)
This method ignores the return value of one of the variants of java.io.InputStream.read()
which can return multiple bytes. If the return value is not checked, the caller will not be able to correctly handle the case where fewer bytes were read than the caller requested. This is a particularly insidious kind of bug, because in many programs, reads from input streams usually do read the full amount of data requested, causing the program to fail only sporadically.
解决办法: if (inputStream != null) {
ByteArrayOutputStream bytestream = new ByteArrayOutputStream();
int ch;
while ((ch = inputStream.read()) != -1) {
bytestream.write(ch);
}
but = bytestream.toByteArray();
bytestream.close();
}
分享到:
相关推荐
4. **ignores exceptional return value of java.io.File.mkdirs()**:`File.mkdirs()`方法会返回一个布尔值,表示创建目录是否成功。忽略这个返回值可能导致忽视错误。正确做法是检查返回值: ```java if (!exitDir...
Secondly, the program provides for read-only access and does not allow you to make records in file system partitions. This guarantees that the interference in an alterative file system will not ...
Currently Jad ignores the contents of the Line Number Table Attribute and the Source File Attribute(不明白什么意思) 5.JAD不能处理继承信息,总是把java.lang.Object作为两个不同类的通用父类,需要的时候...
XMODEM协议实现可在获得的文档可以在上找到Python Package ... return ser.read(size) or None...>>> def putc(data, timeout=1):... return ser.write(data) # note that this ignores the timeout...>>> modem =
- FIX: The result rectangle incorrectly calculated in the TFlexText.GetRefreshRect method. - FIX: Added FPaintCache.rcPaint cleanup in the TFlexPanel.WMPaint method. Now it is possible to define is ...
a star (*) or a slash (/) ignores those symbols. A printed copy of the Commands Quick Reference Guide is available on the ANSYS Customer Portal in the documentation area. The following Command ...
.inputrc - Autocomplete ignores case. Search with up/down arrows. Visible bell instead of audible. .profile - Heart of things... See below. .shell_colors - Definitions for use by .profile. .toprc - ...
This examples translates a world...It parses the grid in the input file and ignores the other parts. It requires a pre-computed images directory, which can be generated using the SmoothImageSlicer tool.
7)....Added: Streaming unpacked debug info into temporal files instead of memory - this greatly reduces run-time application memory usage at cost of slightly slower exception processing. This also ...
However, WU ignores the ranking of INF compatibleIDs. These are hardware IDs listed in the INF file as compatible with the device but not the exact hardware ID. INF compatibleIDs are ranked lower ...
Shipit-cnpm Shipit的cnpm任务 支持标志 用法 var cnpm = require ( 'shipit-cnpm' ) ; var deploy = require ( 'shipit-deploy' ) ; module .... deploy ( shipit ) ;... shipit .... ignores : [ '.git' ] ,
- fix for wrong display of tables with header and footer rows. Sometimes both were painted without any data. + to load old Hiedit templates as RTF code use the formatstring -HiEditFields. This will ...
including previously installed release notes.Borland recommends that you read this file in its entirety.NOTE: If you are updating a localized version of Delphi 7, visit the Borland Registered User ...
The ASP.NET Chart ignores this property by default now. Chart .NET: Stacked Column + 3D throws an Index was out of range exception when series have a different number of data points The accumulation ...
The Moon lander simulator is a very simple moon landing simulator based on the LEM from Apollo 11, it works in only 2 dimensions and ignores spaceship roll/rotation. The simulation begins after the ...
HDDamus is a professional software package that allows you to analyze your hard disk drive failures, including hardware, and prevent loss of important data with the help of special tools that can fix ...
memory, instead of performing a bytewise read. (Region must be of type SystemMemory, see below.) Fixed the Load ASL operator for the case where the source operand is a region field. A buffer object ...
The availability of drivers that support the features of the specification will simplify the process of developing Windows appli¬cation programs that in-corporate absolute coordinate input, and ...
3. CRV: Method ignores return value:方法忽略了返回值,这可能会导致错误的结果。 FindBugs会检测到这种情况,并报告一个缺陷,提醒开发者检查代码中是否存在错误的结果。 4. ASI: Static initializer invokes ...