Loadable
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.
-
getInputStream(...)
getReader(...)
returns a buffered input-stream/reader to get data from the data-source of the loadable. -
getOutputStream(...)
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.
Remote
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.
RemoteInputStream
RemoteReader
RemoteOutputStream
RemoteWriter
runs its read()/write() methods on a new Do-loop and starts it using its instructor.
Buffers
We needed to build our own Buffer, BufferedReader, and BufferedInputStream. So, here we go.
-
Buffer
is a relative position buffer that behaves like a reader. -
BufferredInputStream
BufferedReader
is the same as java’s version of this but uses the buffer we built.