< prev index next >

src/java.base/share/classes/sun/nio/cs/StreamEncoder.java

Print this page

        

@@ -106,16 +106,16 @@
                 throw new IOException("Stream closed");
         }
     }
 
     public void write(int c) throws IOException {
-        char cbuf[] = new char[1];
+        char[] cbuf = new char[1];
         cbuf[0] = (char) c;
         write(cbuf, 0, 1);
     }
 
-    public void write(char cbuf[], int off, int len) throws IOException {
+    public void write(char[] cbuf, int off, int len) throws IOException {
         synchronized (lock) {
             ensureOpen();
             if ((off < 0) || (off > cbuf.length) || (len < 0) ||
                 ((off + len) > cbuf.length) || ((off + len) < 0)) {
                 throw new IndexOutOfBoundsException();

@@ -128,11 +128,11 @@
 
     public void write(String str, int off, int len) throws IOException {
         /* Check the len before creating a char buffer */
         if (len < 0)
             throw new IndexOutOfBoundsException();
-        char cbuf[] = new char[len];
+        char[] cbuf = new char[len];
         str.getChars(off, off + len, cbuf, 0);
         write(cbuf, 0, len);
     }
 
     public void write(CharBuffer cb) throws IOException {

@@ -272,11 +272,11 @@
             cr.throwException();
         }
         haveLeftoverChar = false;
     }
 
-    void implWrite(char cbuf[], int off, int len)
+    void implWrite(char[] cbuf, int off, int len)
         throws IOException
     {
         CharBuffer cb = CharBuffer.wrap(cbuf, off, len);
         implWrite(cb);
     }
< prev index next >