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

Use existing type-safe enum for ImageInputStream.setByteOrder(...)

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Fixed
    • Icon: P3 P3
    • 1.4.0
    • 1.4.0
    • client-libs
    • beta3
    • generic
    • generic



      Name: bsC130419 Date: 08/30/2001


      java version "1.4.0-beta2"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.0-beta2-b77)
      Java HotSpot(TM) Client VM (build 1.4.0-beta2-b77, mixed mode)

      ImageInputStream.setByteOrder(...) expect a boolean argument: "true" for
      network (big-endian) byte order, and "false" for reverse (little-endian) byte
      order. Such a convention is not really obvious. A type-safe enumeration would
      be more explicit.

      Such an enumeration already exist: the java.nio.ByteOrder class, which provide
      only two static fields: BIG_ENDIAN and LITTLE_ENDIAN. Because this enumeration
      already exists in JDK 1.4 and is just waiting to be used, I suggest to make the
      following replacements:

      Replace
         void ImageInputStream.setByteOrder(boolean)
      by
         void ImageInputStream.setByteOrder(ByteOrder)



      Replace
         boolean ImageInputStream.getByteOrder()
      by
         ByteOrder ImageInputStream.getByteOrder()
      (Review ID: 131076)
      ======================================================================

            dricesunw Daniel Rice (Inactive)
            bstrathesunw Bill Strathearn (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: