forked from JavaTX/JavaCompilerCore
added function for closing file to WriterActiveObject
This commit is contained in:
parent
b3639a3d08
commit
2a92a0e48e
@ -12,10 +12,21 @@ public class WriterActiveObject {
|
|||||||
this.writer = writer;
|
this.writer = writer;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void close(){
|
||||||
|
pool.execute(()->{
|
||||||
|
try {
|
||||||
|
writer.close();
|
||||||
|
} catch (IOException e) {
|
||||||
|
System.out.println(e.getMessage());
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
public void write(String message){
|
public void write(String message){
|
||||||
pool.execute(()->{
|
pool.execute(()->{
|
||||||
try {
|
try {
|
||||||
writer.write(message);
|
writer.write(message);
|
||||||
|
writer.flush();
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
System.out.println(e.getMessage());
|
System.out.println(e.getMessage());
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user