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

results from String.getBytes(s, "UnicodeBig") are in-consistent

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P2
    • Resolution: Fixed
    • Affects Version/s: 1.2.0, 1.3.0
    • Fix Version/s: 1.3.0
    • Component/s: core-libs
    • Labels:
    • Subcomponent:
    • Resolved In Build:
      kestrel
    • CPU:
      generic, sparc
    • OS:
      generic, solaris_2.6

      Description



      Name: dbT83986 Date: 03/15/99


      When String's getBytes() method is called repeatedly
      with the same string, the byte arrary returned by
      this method is different on subsequent calls.

      Given:

         String s = new String("a");
         String encoding = "UnicodeBig";
         byte [] b = null;

      When the following is execute, the length of array b is 4
      (the first two bytes contain the FE and FF):

         b = s.getBytes(encoding);
         System.out.println("LEN = " + b.length);

      If the above two lines are re-executed, the length of
      array b is two (the FE and FF bytes are NOT present):

         b = s.getBytes(encoding);
         System.out.println("LEN = " + b.length);
      (Review ID: 55461)
      ======================================================================

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              mr Mark Reinhold
              Reporter:
              dblairsunw Dave Blair (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: