Uploaded image for project: 'Harmony'
  1. Harmony
  2. HARMONY-26

The API of buffer classes in java.nio are not compliant with the specification of Java 5.0

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • None
    • Classlib
    • None

    Description

      1. java.nio.CharBuffer
      1.1) java.nio.CharBuffer needs to implement two new interface java.lang.Appendable and java.lang.Readable
      1.2) The following methods should NOT be "protected":
      protected CharBuffer(int capacity)
      protected abstract char[] protectedArray();
      protected abstract int protectedArrayOffset();
      protected abstract boolean protectedHasArray();

      1.3) The following method should be "final":
      public CharBuffer put(char[] src)

      2. java.nio.Buffer
      2.1) The following fields should NOT be "protected":
      int UNSET_MARK
      int capacity
      int limit
      int mark should
      int position
      2.3) The following method should NOT be "protected":
      protected Buffer(int capacity)

      3. java.nio.ByteBuffer, DoubleBuffer, FloatBuffer, IntBuffer, LongBuffer, ShortBuffer
      3.1) The following field should NOT be "protected":
      com.ibm.platform.Endianness order
      3.2) The following methods should NOT be "protected":
      protected ByteBuffer(int capacity)
      protected abstract byte[] protectedArray();
      protected abstract int protectedArrayOffset();
      protected abstract boolean protectedHasArray();
      3.3) The following method should be "final":
      public ByteBuffer order(ByteOrder byteOrder)

      4. The implementation of bulk put/get methods of all the buffer classes are low-efficiency

      Attachments

        1. DirectBuffer.java
          1.0 kB
          Richard Liang
        2. nio-tests.jar
          31 kB
          Richard Liang

        Activity

          People

            tellison Tim Ellison
            richard_liang Richard Liang
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: