pipe-io-server/clients/java/PipeReader.java
2019-04-09 14:54:43 +02:00

22 lines
517 B
Java

import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
import java.lang.AutoCloseable;
public class PipeReader implements AutoCloseable {
private BufferedReader pipe;
public PipeReader(String pipe_path) throws IOException {
this.pipe = new BufferedReader(new FileReader(pipe_path));
}
public void close() throws IOException {
this.pipe.close();
}
public String recvMessage() throws IOException {
return this.pipe.readLine();
}
}