Name: dg70945 Date: 09/25/98
The specification of this method should probably clarify that, for a given input stream i, implementations are required to return the same value each time markSupported() is called. In other words, whether or not markSupported() is an invariant property of a particular input stream instance.
I guess this is implicit in the text, but as this is an extremely important invariant for anyone intending to use mark() and reset(), I think it should be made explicit.
Another point I should make is that the text "Returns: true if this type supports the mark and reset method; false otherwise" implies that the markSupported() property is invariant over _classes_ rather than just _instances_. I.e., that:
i1.getClass() == i2.getClass() => i1.markSupported() == i2.markSupported()
where as the earlier text implies:
i1 == i2 => i1.markSupported() == i2.markSupported()
I suspect the latter of these two constraints is the intended interpretation (as well as the more flexible). Anyway, whichever invariant is intended should be made clear in the docs.
regards,
Roly Perera
Interactive Computers Ltd
The Java Spec Report
(Review ID: 39291)
======================================================================
- duplicates
-
JDK-4175791 (spec) InputStream.markSupported: Invariant over all instances?
-
- Closed
-