jdk/src/share/classes/sun/misc/CharacterDecoder.java
changeset 23334 8b590110ed8e
parent 23010 6dadb192ad81
child 23742 c2b6216ef41d
--- a/jdk/src/share/classes/sun/misc/CharacterDecoder.java	Fri Mar 07 13:00:25 2014 -0800
+++ b/jdk/src/share/classes/sun/misc/CharacterDecoder.java	Fri Mar 07 13:05:07 2014 -0800
@@ -183,25 +183,21 @@
      * buffer and returns a byte array containing the data.
      * @exception CEFormatException An error has occurred while decoding
      */
-    public byte decodeBuffer(String inputString)[] throws IOException {
-        byte    inputBuffer[] = new byte[inputString.length()];
-        ByteArrayInputStream inStream;
-        ByteArrayOutputStream outStream;
-
-        inputString.getBytes(0, inputString.length(), inputBuffer, 0);
-        inStream = new ByteArrayInputStream(inputBuffer);
-        outStream = new ByteArrayOutputStream();
+    public byte[] decodeBuffer(String inputString) throws IOException {
+        byte inputBuffer[] = inputString.getBytes();
+        ByteArrayInputStream inStream = new ByteArrayInputStream(inputBuffer);
+        ByteArrayOutputStream outStream = new ByteArrayOutputStream();
         decodeBuffer(inStream, outStream);
-        return (outStream.toByteArray());
+        return outStream.toByteArray();
     }
 
     /**
      * Decode the contents of the inputstream into a buffer.
      */
-    public byte decodeBuffer(InputStream in)[] throws IOException {
+    public byte[] decodeBuffer(InputStream in) throws IOException {
         ByteArrayOutputStream outStream = new ByteArrayOutputStream();
         decodeBuffer(in, outStream);
-        return (outStream.toByteArray());
+        return outStream.toByteArray();
     }
 
     /**