Methods Summary |
---|
private void | checkClosed()
if (closed) throw new IOException("Writer is closed");
|
public void | close()
closed = true;
this.flush();
out.close();
|
public void | flush()
flushInternal();
out.flush();
|
private void | flushInternal()
if (position != 0) {
out.write(buffer, 0, position);
position = 0;
}
|
public void | write(char[] text, int offset, int length)
checkClosed();
while (length > 0) {
int n = Math.min(CAPACITY - position, length);
System.arraycopy(text, offset, buffer, position, n);
position += n;
offset += n;
length -= n;
if (position >= CAPACITY) flushInternal();
}
|
public void | write(java.lang.String s)
write(s, 0, s.length());
|
public void | write(java.lang.String s, int offset, int length)
checkClosed();
while (length > 0) {
int n = Math.min(CAPACITY - position, length);
s.getChars(offset, offset + n, buffer, position);
position += n;
offset += n;
length -= n;
if (position >= CAPACITY) flushInternal();
}
|
public void | write(int c)
checkClosed();
if (position >= CAPACITY) flushInternal();
buffer[position] = (char) c;
position++;
|