< prev index next >

src/java.base/share/classes/java/io/CharArrayReader.java

Print this page

        

@@ -32,11 +32,11 @@
  * @author      Herb Jellinek
  * @since       1.1
  */
 public class CharArrayReader extends Reader {
     /** The character buffer. */
-    protected char buf[];
+    protected char[] buf;
 
     /** The current buffer position. */
     protected int pos;
 
     /** The position of mark in buffer. */

@@ -50,11 +50,11 @@
 
     /**
      * Creates a CharArrayReader from the specified array of chars.
      * @param buf       Input buffer (not copied)
      */
-    public CharArrayReader(char buf[]) {
+    public CharArrayReader(char[] buf) {
         this.buf = buf;
         this.pos = 0;
         this.count = buf.length;
     }
 

@@ -73,11 +73,11 @@
      *
      * @param buf       Input buffer (not copied)
      * @param offset    Offset of the first char to read
      * @param length    Number of chars to read
      */
-    public CharArrayReader(char buf[], int offset, int length) {
+    public CharArrayReader(char[] buf, int offset, int length) {
         if ((offset < 0) || (offset > buf.length) || (length < 0) ||
             ((offset + length) < 0)) {
             throw new IllegalArgumentException();
         }
         this.buf = buf;

@@ -116,11 +116,11 @@
      *          the end of the stream has been reached
      *
      * @exception   IOException  If an I/O error occurs
      * @exception   IndexOutOfBoundsException {@inheritDoc}
      */
-    public int read(char b[], int off, int len) throws IOException {
+    public int read(char[] b, int off, int len) throws IOException {
         synchronized (lock) {
             ensureOpen();
             if ((off < 0) || (off > b.length) || (len < 0) ||
                 ((off + len) > b.length) || ((off + len) < 0)) {
                 throw new IndexOutOfBoundsException();
< prev index next >