public abstract class Writer extends Object implements AutoCloseable
Modifier and Type | Field and Description |
---|---|
protected Object |
lock
The object used to synchronize operations on this stream.
|
Modifier | Constructor and Description |
---|---|
protected |
Writer()
Create a new character-stream writer whose critical sections will synchronize on the writer itself.
|
protected |
Writer(Object lock)
Create a new character-stream writer whose critical sections will synchronize on the given object.
|
Modifier and Type | Method and Description |
---|---|
abstract void |
close()
Close the stream, flushing it first.
|
abstract void |
flush()
Flush the stream.
|
void |
write(char[] cbuf)
Write an array of characters.
|
abstract void |
write(char[] cbuf,
int off,
int len)
Write a portion of an array of characters.
|
void |
write(int c)
Write a single character.
|
void |
write(String str)
Write a string.
|
void |
write(String str,
int off,
int len)
Write a portion of a string.
|
protected Object lock
protected Writer()
protected Writer(Object lock)
public abstract void close() throws IOException
close
in interface AutoCloseable
IOException
public abstract void flush() throws IOException
IOException
public void write(char[] cbuf) throws IOException
IOException
public abstract void write(char[] cbuf, int off, int len) throws IOException
IOException
public void write(int c) throws IOException
IOException
public void write(String str) throws IOException
IOException
public void write(String str, int off, int len) throws IOException
IOException