diff options
author | Ben Smith-Mannschott <bsmith.occs@gmail.com> | 2010-01-26 21:23:05 +0100 |
---|---|---|
committer | Stuart Halloway <stu@thinkrelevance.com> | 2010-04-14 21:04:52 -0400 |
commit | 9cd7b155149c6e20b799528c6d5bf2f0e553e9f3 (patch) | |
tree | cca0e08886dfdc55c7d04020c8e2723da6fbab83 /modules/java-utils | |
parent | b52f0b60c0e777724fa3591c43bdba83a16968c8 (diff) |
c.c.io provides input-stream and output-stream for byte-oriented I/O
clojure.contrib.io already supports character-oriented I/O through the
multi-methods reader and writer. This patch adds support for
byte-oriented I/O by providing the multi-methods input-stream and
output-stream.
* input-stream knows how to open InputStreams for reading bytes.
* reader has been refactored to build on input-stream.
* output-stream knows how to open OutputStreams for writing bytes.
* writer has been refactored to build on output-stream (where sensible)
By recognizing that output-stream will throw exceptions for us if it's
unable to open the underlying resource, we were able to use the
:default method to cover URL, URI and Socket.
The String writer has not been touched. (Writing it in terms of
output-stream would have made it longer and more complex.)
* *append-to-writer* has been renamed to *append* for use with
output-streams without souding foolish.
This is a breaking change for clients that bind *append-to-writer*
instead of calling append-writer or append-split as recommended in
the docsting.
* Like writer, output-stream consults the current binding of *append*.
* append-output-stream is analagous to append-writer.
Like append-writer, the implementation looks very general, but in
reality it only works for files.
Signed-off-by: Stuart Halloway <stu@thinkrelevance.com>
Diffstat (limited to 'modules/java-utils')
0 files changed, 0 insertions, 0 deletions