diff options
author | Aaron M. Renn <arenn@urbanophile.com> | 1998-12-02 01:15:10 +0000 |
---|---|---|
committer | Aaron M. Renn <arenn@urbanophile.com> | 1998-12-02 01:15:10 +0000 |
commit | 9ed738577b932f75b48ea3e6d06851376a7d732b (patch) | |
tree | 6fc5f4301aa0ae3bd86a4be545fe59aa0f232a48 /java/io/PushbackInputStream.java | |
parent | f07c72b804022f2ba8dcd24454746a280f621f8f (diff) | |
download | classpath-9ed738577b932f75b48ea3e6d06851376a7d732b.tar.gz |
Made vars 'pos' and 'buf' protected and added close() method to comply
with spec. However, I did not delete my reset() method to comply with
the spec because in my estimation it is needed. PBIS subclasses from
FilterInputStream, which redirects the call to reset() to the underlying
InputStream it is wrappering. If that InputStream supported mark/reset,
then the stream position could be messed up. Therefore we need to
override this method and throw and exception in it.
Diffstat (limited to 'java/io/PushbackInputStream.java')
-rw-r--r-- | java/io/PushbackInputStream.java | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/java/io/PushbackInputStream.java b/java/io/PushbackInputStream.java index 2d9fa57d0..bc7836621 100644 --- a/java/io/PushbackInputStream.java +++ b/java/io/PushbackInputStream.java @@ -58,7 +58,7 @@ private static final int DEFAULT_BUFFER_SIZE = 1; /** * This is the buffer that is used to store the pushed back data */ -private byte[] buf; +protected byte[] buf; /** * This is the position in the buffer from which the next byte will be @@ -67,7 +67,7 @@ private byte[] buf; * <code>pos</code> is 0 the buffer is full and <code>buf.length</code> when * it is empty */ -private int pos; +protected int pos; /*************************************************************************/ @@ -114,6 +114,19 @@ PushbackInputStream(InputStream in, int bufsize) */ /** + * This method closes the stream and releases any associated resources. + * + * @exception IOException If an error occurs. + */ +public void +close() throws IOException +{ + super.close(); +} + +/*************************************************************************/ + +/** * This method returns <code>false</code> to indicate that it does not support * mark/reset functionality. * |