Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4248473

(nio) InputStream should have native read method for bytearray

    • Icon: Enhancement Enhancement
    • Resolution: Duplicate
    • Icon: P4 P4
    • None
    • 1.2.0
    • core-libs
    • generic
    • generic



      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)
      ======================================================================

            mmcclosksunw Michael Mccloskey (Inactive)
            vasya Vassili Igouchkine (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: