JDK-4248473 : (nio) InputStream should have native read method for bytearray
  • Type: Enhancement
  • Component: core-libs
  • Sub-Component: java.io
  • Affected Version: 1.2.0
  • Priority: P4
  • Status: Closed
  • Resolution: Duplicate
  • OS: generic
  • CPU: generic
  • Submitted: 1999-06-22
  • Updated: 2001-11-02
  • Resolved: 2001-11-02
Related Reports
Duplicate :  
Description

Name: vi73552			Date: 06/22/99


In jdk1.1 and jdk1.2 the read(byte[]) of the InputStream class
is implemented as a simple for-loop reading byte by byte from the inputstream.  This applies to OutputStream in the write(byte[]) method.  This implementation is causing a major degradation in the IO performance.  The speed degradation can be reduced by using BufferedInputStream but the IO utilisation is still noticeably high. The performance problem is very noticeable when a large file/packet is being read.  Another point is that, why can't the method be implemented using native calls. The FileInputStream does implement native read and write buffer. Why is there a inconsistency in the implementation of InputStreams?  I believe that by using native calls , the Java IO will be substantially improved (if implemented properly).
(Review ID: 84631) 
======================================================================

Comments
EVALUATION This problem will be addressed in the new io framework. michael.mccloskey@eng 1999-10-28
28-10-1999