The ways to load and save data is different from a position to another, but at the end it still data and still be loaded and saved using protocols and standards. Loadables in the other hand don't care about how the data will be transferred, as long as the data will be transferred successfully.
getReader(...)returns a buffered input-stream/reader to get data from the data-source of the loadable.
getWriter(...)returns an output-stream/writer to save data on the data-source of the loadable.
load(...)makes the loadable load data from its data-source to itself.
save(...)makes the loadable save data from itself to its data-source.
One of the solutions to control an input-stream, output-stream, reader, or a writer concurrently is to wrap it with a control instance. The control-instance checks for the state of its instructor before doing anything.
RemoteWriterruns its read()/write() methods on a new Do-loop and starts it using its instructor.
We needed to build our own Buffer, BufferedReader, and BufferedInputStream. So, here we go.
Bufferis a relative position buffer that behaves like a reader.
BufferedReaderis the same as java’s version of this but uses the buffer we built.