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

UnsupportedEncodingException when trying to create writable output stream

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Not an Issue
    • Icon: P4 P4
    • None
    • 1.1.8
    • core-libs



      Name: bsT130419 Date: 09/21/2001


      Illegal option: -version
      Java(tm) Runtime Loader Version 1.1.8_008
      Usage: jre [-options] classname [arguments]

        To produce this problem all I did was execute this method. The value passed as
      the encoding scheme was "MS932". Name was just some random string of
      alphanumeric characters.

      /**
           * Write an entry to the stream representation of the AttributeSet.
           *
           * @param name The Name to write to the stream.
           * @param value The Names corresponding value.
           * @param encScheme The encoding scheme to use when placing
           * data in the stream.
           * @param ds DataOutputStream to write to.
           *
           */

          private void writeStreamEntry(Name name, Value value, String encScheme,
      DataOutputStream ds)
                          throws IOException {
          
              // Include an entry in the output stream.
              String mappedName = name.getName();

              try {
                  // Write the length of the name string.
              
                  ds.writeInt(mappedName.length() + 1);
              
                  // Write the name string followed by a null.
                  byte[] translate = mappedName.getBytes(encScheme);
                  ds.write(translate, 0, translate.length);
                  ds.writeByte(0);
                  
                  // Now write out the value.
                  
                  value.toDataOutputStream(ds, name.getType());
              }
              catch (IOException e)
              {
                  //
                  // Caught an I/O exception building the OutputStream. Throw
                  // back to the invoker after tracing the problem.
                  //
          
                  if (trace != null) {
                      trace.level(Trace.ERROR).record("Attribute Set: converting to
      data output stream, exception is" + e);
                  }

                  e.printStackTrace();
                  
                  throw e;
              }
          }


      java.io.UnsupportedEncodingException
              at java.lang.Throwable.<init>(Compiled Code)
              at java.lang.Exception.<init>(Compiled Code)
              at java.io.IOException.<init>(Compiled Code)
              at java.io.UnsupportedEncodingException.<init>(Compiled Code)
              at sun.io.CharToByteConverter.getConverter(Compiled Code)
              at java.lang.String.getBytes(String.java:526)
              at com.storagetek.blackhawk.request.AttributeSet.writeStreamEntry
      (AttributeSet.java)
              at com.storagetek.blackhawk.request.AttributeSet.toDataOutputStream
      (Compiled Code)
              at com.storagetek.blackhawk.api.LLAPISnapShot.createInput
      (LLAPISnapShot.java)
              at com.storagetek.blackhawk.api.LLAPI.createAPIbuffer(Compiled Code)
              at com.storagetek.blackhawk.api.LLAPI.execute(LLAPI.java)
              at com.storagetek.blackhawk.api.LLAPI.execute(LLAPI.java)
              at com.storagetek.blackhawk.request.partition.SnapShotCopier.execute
      (Compiled Code)
              at com.storagetek.blackhawk.request.partition.Copier.execute(Compiled
      Code)
              at
      com.storagetek.blackhawk.request.partition.SnapShotPartition.executeLocal
      (SnapShotPartition.java)
              at com.storagetek.blackhawk.request.partition.PartitionManager.execute
      (PartitionManager.java)
              at com.storagetek.blackhawk.request.Request.executeAgainst(Compiled
      Code)
              at com.storagetek.blackhawk.request.Request$2.run(Request.java)
      java.io.UnsupportedEncodingException
              at java.lang.Throwable.<init>(Compiled Code)
              at java.lang.Exception.<init>(Compiled Code)
              at java.io.IOException.<init>(Compiled Code)
              at java.io.UnsupportedEncodingException.<init>(Compiled Code)
              at sun.io.CharToByteConverter.getConverter(Compiled Code)
              at java.lang.String.getBytes(String.java:526)
              at com.storagetek.blackhawk.request.AttributeSet.writeStreamEntry
      (AttributeSet.java)
              at com.storagetek.blackhawk.request.AttributeSet.toDataOutputStream
      (Compiled Code)


      This method creates a writeable data stream that is eventually passed to C
      methods via the Java Native Interface (JNI). The C methods use the Win32 API.
      (Review ID: 131877)
      ======================================================================

            ilittlesunw Ian Little (Inactive)
            bstrathesunw Bill Strathearn (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: