mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 06:45:07 +02:00
8305457: Implement java.io.IO
Reviewed-by: naoto, smarks, jpai, jlahoda
This commit is contained in:
parent
6a35311468
commit
c099f14f07
15 changed files with 695 additions and 5 deletions
|
@ -81,6 +81,42 @@ final class ProxyingConsole extends Console {
|
|||
return reader;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public Console println(Object obj) {
|
||||
synchronized (writeLock) {
|
||||
delegate.println(obj);
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public Console print(Object obj) {
|
||||
synchronized (writeLock) {
|
||||
delegate.print(obj);
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*
|
||||
* @throws IOError {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public String readln(String prompt) {
|
||||
synchronized (writeLock) {
|
||||
synchronized (readLock) {
|
||||
return delegate.readln(prompt);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue