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

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

    XMLWordPrintable

    Details

    • Type: Enhancement
    • Status: Closed
    • Priority: P4
    • Resolution: Won't Fix
    • Affects Version/s: 1.4.2
    • Fix Version/s: None
    • Component/s: core-libs
    • Labels:
    • Subcomponent:
    • CPU:
      x86
    • OS:
      windows_xp

      Description



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

        Attachments

          Activity

            People

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

              Dates

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: