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

(bf) ByteBuffer.clear(byte b) to clear AND erase the buffer

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Won't Fix
    • Icon: P4 P4
    • None
    • 1.4.2
    • core-libs
    • x86
    • windows_xp



      Name: rmT116609 Date: 10/09/2003


      A DESCRIPTION OF THE REQUEST :
      NIO team

      Just a small functionnal extension that could be useful for people dealing with
      non java native file type (i.e EBCDIC or COBOL files).


      1/ java.nio.ByteBuffer.clear(byte b)
      Add an clear(byte b) method to java.nio.Buffer in order to fill the backing array of bytes if is exists with the same single byte value specified by the parameter b. Useful for implemeting the semantic of the COBOL CHARACTER string which states that strings (which are bytes) are padded by SPACE (0x20 in ASCII or 0x40 in EBCDIC).

      2/java.nio.ByteBuffer.allocate(int capacity, byte b)
      For the same reason as previously stated, but for the initial allocation and initialization.


      JUSTIFICATION :
      This small enhancement could help in increasing lisibility and abstraction of the usage of a ByteBuffer
      (Incident Review ID: 209832)
      ======================================================================

            iris Iris Clark
            rmandalasunw Ranjith Mandala (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: