< prev index next >
src/java.base/share/classes/java/io/CharArrayWriter.java
Print this page
*** 42,52 ****
public
class CharArrayWriter extends Writer {
/**
* The buffer where data is stored.
*/
! protected char buf[];
/**
* The number of chars in the buffer.
*/
protected int count;
--- 42,52 ----
public
class CharArrayWriter extends Writer {
/**
* The buffer where data is stored.
*/
! protected char[] buf;
/**
* The number of chars in the buffer.
*/
protected int count;
*** 95,105 ****
* @throws IndexOutOfBoundsException
* If {@code off} is negative, or {@code len} is negative,
* or {@code off + len} is negative or greater than the length
* of the given array
*/
! public void write(char c[], int off, int len) {
if ((off < 0) || (off > c.length) || (len < 0) ||
((off + len) > c.length) || ((off + len) < 0)) {
throw new IndexOutOfBoundsException();
} else if (len == 0) {
return;
--- 95,105 ----
* @throws IndexOutOfBoundsException
* If {@code off} is negative, or {@code len} is negative,
* or {@code off + len} is negative or greater than the length
* of the given array
*/
! public void write(char[] c, int off, int len) {
if ((off < 0) || (off > c.length) || (len < 0) ||
((off + len) > c.length) || ((off + len) < 0)) {
throw new IndexOutOfBoundsException();
} else if (len == 0) {
return;
< prev index next >