[e-lang] Joe-E ByteArray stream interface and character encoding/decoding
David Hopwood
david.hopwood at industrial-designers.co.uk
Thu Oct 18 12:02:11 EDT 2007
Adrian Mettler wrote:
> Here are the proposed implementations for stream adapter logic in
> ByteArray and character encoding/decoding routines to and from ASCII and
> UTF-8 in Joe-E. Tyler suggested that I let you take a look at them and
> see if there are any unintended bugs or sources of nondeterminism.
ASCII.input and UTF8.input return an InputStreamReader. The javadoc for
InputStreamReader.getEncoding says:
# This method may return null if the stream has been closed.
InputStreamReader.ready says
# Returns: True if the next read() is guaranteed not to block for
# input, false otherwise. Note that returning false does not guarantee
# that the next read will block.
Wording such as "may" and "does not guarantee" implies specification
nondeterminism. I don't know whether this is just reflecting the fact
that the underlying InputStream may be nondeterministic (in Java).
How strict do we want to be about specification nondeterminism in
tamed APIs?
--
David Hopwood
More information about the e-lang
mailing list