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

(prefs) Preferences.putByteArray(byte[], int, int) convenience overload

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Unresolved
    • Icon: P4 P4
    • None
    • 1.4.1
    • core-libs
    • Fix Understood
    • x86
    • windows_2000

      Name: rmT116609 Date: 12/20/2002


      DESCRIPTION OF THE PROBLEM :
      It would be a wonder time-saver and performance-enhancer to overload the method putByteArray() in java.util.prefs.Preferences with the following:

      public void putByteArray(byte[] array, int start, int len);

      That way the developer doesn't have to make his/her byte array exactly the size of the data being saved.

      CUSTOMER WORKAROUND :
      public static void put(Preferences p,
                             byte[] array,
                             int start,
                             int len) {

      byte[] shrinkyDink = new byte[len];
      System.arraycopy(array, start, shrinkyDink, 0, len);
      p.putByteArray(shrinkyDink);
      } //Ends method put
      (Review ID: 179352)
      ======================================================================
      ###@###.### 11/3/04 20:37 GMT

            sherman Xueming Shen
            rmandalasunw Ranjith Mandala (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Imported:
              Indexed: