I need a stream (or something) to which i can write and read using streams, both from program in Java, here is some example:
CustomStream stream = new CustomStream();
BufferedReader reader = new BufferedReader(new InputStreamReader(stream.getInputStream());
PrintWriter pw = new PrintWriter(stream.getOutputStream());
pw.println("Hello");
pw.println("World");
System.out.println(reader.readLine()); //Hello
System.out.println(reader.readLine()); //World
Guess this is pretty retarded example, but is there any way to do it, except implementing all methods from abstract Stream class?