annotate src/goodjava/io/BufferedInputStream.java @ 1487:044a360c2300

minor
author Franklin Schmidt <fschmidt@gmail.com>
date Fri, 01 May 2020 16:17:20 -0600
parents 97740900c820
children fe237d72b234
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1478
37e582f2e266 clone BufferedInputStream
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
1 /*
37e582f2e266 clone BufferedInputStream
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
2 * Copyright (c) 1994, 2013, Oracle and/or its affiliates. All rights reserved.
37e582f2e266 clone BufferedInputStream
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
3 * ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
37e582f2e266 clone BufferedInputStream
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
4 */
37e582f2e266 clone BufferedInputStream
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
5
37e582f2e266 clone BufferedInputStream
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
6 package goodjava.io;
37e582f2e266 clone BufferedInputStream
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
7
37e582f2e266 clone BufferedInputStream
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
8 import java.io.InputStream;
37e582f2e266 clone BufferedInputStream
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
9 import java.io.FilterInputStream;
37e582f2e266 clone BufferedInputStream
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
10 import java.io.IOException;
37e582f2e266 clone BufferedInputStream
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
11
37e582f2e266 clone BufferedInputStream
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
12 /**
37e582f2e266 clone BufferedInputStream
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
13 * A <code>BufferedInputStream</code> adds
37e582f2e266 clone BufferedInputStream
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
14 * functionality to another input stream-namely,
1480
1f41e5921090 input buffering
Franklin Schmidt <fschmidt@gmail.com>
parents: 1479
diff changeset
15 * the ability to buffer the input. When the <code>BufferedInputStream</code>
1478
37e582f2e266 clone BufferedInputStream
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
16 * is created, an internal buffer array is
37e582f2e266 clone BufferedInputStream
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
17 * created. As bytes from the stream are read
37e582f2e266 clone BufferedInputStream
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
18 * or skipped, the internal buffer is refilled
37e582f2e266 clone BufferedInputStream
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
19 * as necessary from the contained input stream,
1480
1f41e5921090 input buffering
Franklin Schmidt <fschmidt@gmail.com>
parents: 1479
diff changeset
20 * many bytes at a time.
1478
37e582f2e266 clone BufferedInputStream
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
21 *
37e582f2e266 clone BufferedInputStream
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
22 * @author Arthur van Hoff
37e582f2e266 clone BufferedInputStream
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
23 * @since JDK1.0
37e582f2e266 clone BufferedInputStream
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
24 */
1480
1f41e5921090 input buffering
Franklin Schmidt <fschmidt@gmail.com>
parents: 1479
diff changeset
25 public final class BufferedInputStream extends FilterInputStream {
1f41e5921090 input buffering
Franklin Schmidt <fschmidt@gmail.com>
parents: 1479
diff changeset
26 private final byte buf[];
1478
37e582f2e266 clone BufferedInputStream
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
27
1479
Franklin Schmidt <fschmidt@gmail.com>
parents: 1478
diff changeset
28 /**
Franklin Schmidt <fschmidt@gmail.com>
parents: 1478
diff changeset
29 * The index one greater than the index of the last valid byte in
Franklin Schmidt <fschmidt@gmail.com>
parents: 1478
diff changeset
30 * the buffer.
Franklin Schmidt <fschmidt@gmail.com>
parents: 1478
diff changeset
31 * This value is always
Franklin Schmidt <fschmidt@gmail.com>
parents: 1478
diff changeset
32 * in the range <code>0</code> through <code>buf.length</code>;
Franklin Schmidt <fschmidt@gmail.com>
parents: 1478
diff changeset
33 * elements <code>buf[0]</code> through <code>buf[count-1]
Franklin Schmidt <fschmidt@gmail.com>
parents: 1478
diff changeset
34 * </code>contain buffered input data obtained
1480
1f41e5921090 input buffering
Franklin Schmidt <fschmidt@gmail.com>
parents: 1479
diff changeset
35 * from the underlying input stream.
1479
Franklin Schmidt <fschmidt@gmail.com>
parents: 1478
diff changeset
36 */
1480
1f41e5921090 input buffering
Franklin Schmidt <fschmidt@gmail.com>
parents: 1479
diff changeset
37 private int count;
1478
37e582f2e266 clone BufferedInputStream
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
38
1479
Franklin Schmidt <fschmidt@gmail.com>
parents: 1478
diff changeset
39 /**
Franklin Schmidt <fschmidt@gmail.com>
parents: 1478
diff changeset
40 * The current position in the buffer. This is the index of the next
Franklin Schmidt <fschmidt@gmail.com>
parents: 1478
diff changeset
41 * character to be read from the <code>buf</code> array.
Franklin Schmidt <fschmidt@gmail.com>
parents: 1478
diff changeset
42 * <p>
Franklin Schmidt <fschmidt@gmail.com>
parents: 1478
diff changeset
43 * This value is always in the range <code>0</code>
Franklin Schmidt <fschmidt@gmail.com>
parents: 1478
diff changeset
44 * through <code>count</code>. If it is less
Franklin Schmidt <fschmidt@gmail.com>
parents: 1478
diff changeset
45 * than <code>count</code>, then <code>buf[pos]</code>
Franklin Schmidt <fschmidt@gmail.com>
parents: 1478
diff changeset
46 * is the next byte to be supplied as input;
Franklin Schmidt <fschmidt@gmail.com>
parents: 1478
diff changeset
47 * if it is equal to <code>count</code>, then
Franklin Schmidt <fschmidt@gmail.com>
parents: 1478
diff changeset
48 * the next <code>read</code> or <code>skip</code>
Franklin Schmidt <fschmidt@gmail.com>
parents: 1478
diff changeset
49 * operation will require more bytes to be
Franklin Schmidt <fschmidt@gmail.com>
parents: 1478
diff changeset
50 * read from the contained input stream.
Franklin Schmidt <fschmidt@gmail.com>
parents: 1478
diff changeset
51 *
Franklin Schmidt <fschmidt@gmail.com>
parents: 1478
diff changeset
52 * @see java.io.BufferedInputStream#buf
Franklin Schmidt <fschmidt@gmail.com>
parents: 1478
diff changeset
53 */
1480
1f41e5921090 input buffering
Franklin Schmidt <fschmidt@gmail.com>
parents: 1479
diff changeset
54 private int pos;
1478
37e582f2e266 clone BufferedInputStream
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
55
1479
Franklin Schmidt <fschmidt@gmail.com>
parents: 1478
diff changeset
56 /**
Franklin Schmidt <fschmidt@gmail.com>
parents: 1478
diff changeset
57 * Creates a <code>BufferedInputStream</code>
Franklin Schmidt <fschmidt@gmail.com>
parents: 1478
diff changeset
58 * and saves its argument, the input stream
Franklin Schmidt <fschmidt@gmail.com>
parents: 1478
diff changeset
59 * <code>in</code>, for later use. An internal
Franklin Schmidt <fschmidt@gmail.com>
parents: 1478
diff changeset
60 * buffer array is created and stored in <code>buf</code>.
Franklin Schmidt <fschmidt@gmail.com>
parents: 1478
diff changeset
61 *
Franklin Schmidt <fschmidt@gmail.com>
parents: 1478
diff changeset
62 * @param in the underlying input stream.
Franklin Schmidt <fschmidt@gmail.com>
parents: 1478
diff changeset
63 */
Franklin Schmidt <fschmidt@gmail.com>
parents: 1478
diff changeset
64 public BufferedInputStream(InputStream in) {
1483
Franklin Schmidt <fschmidt@gmail.com>
parents: 1480
diff changeset
65 this(in, 8192);
1479
Franklin Schmidt <fschmidt@gmail.com>
parents: 1478
diff changeset
66 }
1478
37e582f2e266 clone BufferedInputStream
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
67
1479
Franklin Schmidt <fschmidt@gmail.com>
parents: 1478
diff changeset
68 /**
Franklin Schmidt <fschmidt@gmail.com>
parents: 1478
diff changeset
69 * Creates a <code>BufferedInputStream</code>
Franklin Schmidt <fschmidt@gmail.com>
parents: 1478
diff changeset
70 * with the specified buffer size,
Franklin Schmidt <fschmidt@gmail.com>
parents: 1478
diff changeset
71 * and saves its argument, the input stream
Franklin Schmidt <fschmidt@gmail.com>
parents: 1478
diff changeset
72 * <code>in</code>, for later use. An internal
Franklin Schmidt <fschmidt@gmail.com>
parents: 1478
diff changeset
73 * buffer array of length <code>size</code>
Franklin Schmidt <fschmidt@gmail.com>
parents: 1478
diff changeset
74 * is created and stored in <code>buf</code>.
Franklin Schmidt <fschmidt@gmail.com>
parents: 1478
diff changeset
75 *
Franklin Schmidt <fschmidt@gmail.com>
parents: 1478
diff changeset
76 * @param in the underlying input stream.
Franklin Schmidt <fschmidt@gmail.com>
parents: 1478
diff changeset
77 * @param size the buffer size.
Franklin Schmidt <fschmidt@gmail.com>
parents: 1478
diff changeset
78 */
Franklin Schmidt <fschmidt@gmail.com>
parents: 1478
diff changeset
79 public BufferedInputStream(InputStream in, int size) {
Franklin Schmidt <fschmidt@gmail.com>
parents: 1478
diff changeset
80 super(in);
Franklin Schmidt <fschmidt@gmail.com>
parents: 1478
diff changeset
81 buf = new byte[size];
Franklin Schmidt <fschmidt@gmail.com>
parents: 1478
diff changeset
82 }
1478
37e582f2e266 clone BufferedInputStream
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
83
1479
Franklin Schmidt <fschmidt@gmail.com>
parents: 1478
diff changeset
84 /**
1480
1f41e5921090 input buffering
Franklin Schmidt <fschmidt@gmail.com>
parents: 1479
diff changeset
85 * Fills the buffer with more data.
1479
Franklin Schmidt <fschmidt@gmail.com>
parents: 1478
diff changeset
86 * Assumes that it is being called by a synchronized method.
Franklin Schmidt <fschmidt@gmail.com>
parents: 1478
diff changeset
87 * This method also assumes that all data has already been read in,
Franklin Schmidt <fschmidt@gmail.com>
parents: 1478
diff changeset
88 * hence pos > count.
Franklin Schmidt <fschmidt@gmail.com>
parents: 1478
diff changeset
89 */
Franklin Schmidt <fschmidt@gmail.com>
parents: 1478
diff changeset
90 private void fill() throws IOException {
1480
1f41e5921090 input buffering
Franklin Schmidt <fschmidt@gmail.com>
parents: 1479
diff changeset
91 pos = 0;
1f41e5921090 input buffering
Franklin Schmidt <fschmidt@gmail.com>
parents: 1479
diff changeset
92 count = 0;
1f41e5921090 input buffering
Franklin Schmidt <fschmidt@gmail.com>
parents: 1479
diff changeset
93 int n = super.read(buf, 0, buf.length);
1479
Franklin Schmidt <fschmidt@gmail.com>
parents: 1478
diff changeset
94 if (n > 0)
1480
1f41e5921090 input buffering
Franklin Schmidt <fschmidt@gmail.com>
parents: 1479
diff changeset
95 count = n;
1479
Franklin Schmidt <fschmidt@gmail.com>
parents: 1478
diff changeset
96 }
1478
37e582f2e266 clone BufferedInputStream
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
97
1479
Franklin Schmidt <fschmidt@gmail.com>
parents: 1478
diff changeset
98 /**
Franklin Schmidt <fschmidt@gmail.com>
parents: 1478
diff changeset
99 * See
Franklin Schmidt <fschmidt@gmail.com>
parents: 1478
diff changeset
100 * the general contract of the <code>read</code>
Franklin Schmidt <fschmidt@gmail.com>
parents: 1478
diff changeset
101 * method of <code>InputStream</code>.
Franklin Schmidt <fschmidt@gmail.com>
parents: 1478
diff changeset
102 *
Franklin Schmidt <fschmidt@gmail.com>
parents: 1478
diff changeset
103 * @return the next byte of data, or <code>-1</code> if the end of the
Franklin Schmidt <fschmidt@gmail.com>
parents: 1478
diff changeset
104 * stream is reached.
Franklin Schmidt <fschmidt@gmail.com>
parents: 1478
diff changeset
105 * @exception IOException if this input stream has been closed by
Franklin Schmidt <fschmidt@gmail.com>
parents: 1478
diff changeset
106 * invoking its {@link #close()} method,
Franklin Schmidt <fschmidt@gmail.com>
parents: 1478
diff changeset
107 * or an I/O error occurs.
Franklin Schmidt <fschmidt@gmail.com>
parents: 1478
diff changeset
108 * @see java.io.FilterInputStream#in
Franklin Schmidt <fschmidt@gmail.com>
parents: 1478
diff changeset
109 */
Franklin Schmidt <fschmidt@gmail.com>
parents: 1478
diff changeset
110 public synchronized int read() throws IOException {
Franklin Schmidt <fschmidt@gmail.com>
parents: 1478
diff changeset
111 if (pos >= count) {
Franklin Schmidt <fschmidt@gmail.com>
parents: 1478
diff changeset
112 fill();
Franklin Schmidt <fschmidt@gmail.com>
parents: 1478
diff changeset
113 if (pos >= count)
Franklin Schmidt <fschmidt@gmail.com>
parents: 1478
diff changeset
114 return -1;
Franklin Schmidt <fschmidt@gmail.com>
parents: 1478
diff changeset
115 }
1480
1f41e5921090 input buffering
Franklin Schmidt <fschmidt@gmail.com>
parents: 1479
diff changeset
116 return buf[pos++] & 0xff;
1479
Franklin Schmidt <fschmidt@gmail.com>
parents: 1478
diff changeset
117 }
1478
37e582f2e266 clone BufferedInputStream
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
118
1479
Franklin Schmidt <fschmidt@gmail.com>
parents: 1478
diff changeset
119 /**
Franklin Schmidt <fschmidt@gmail.com>
parents: 1478
diff changeset
120 * Read characters into a portion of an array, reading from the underlying
Franklin Schmidt <fschmidt@gmail.com>
parents: 1478
diff changeset
121 * stream at most once if necessary.
Franklin Schmidt <fschmidt@gmail.com>
parents: 1478
diff changeset
122 */
1480
1f41e5921090 input buffering
Franklin Schmidt <fschmidt@gmail.com>
parents: 1479
diff changeset
123 public synchronized int read(byte[] b, int off, int len) throws IOException {
1479
Franklin Schmidt <fschmidt@gmail.com>
parents: 1478
diff changeset
124 int avail = count - pos;
Franklin Schmidt <fschmidt@gmail.com>
parents: 1478
diff changeset
125 if (avail <= 0) {
1480
1f41e5921090 input buffering
Franklin Schmidt <fschmidt@gmail.com>
parents: 1479
diff changeset
126 /* If the requested length is at least as large as the buffer, do not bother to copy the
1479
Franklin Schmidt <fschmidt@gmail.com>
parents: 1478
diff changeset
127 bytes into the local buffer. In this way buffered streams will
Franklin Schmidt <fschmidt@gmail.com>
parents: 1478
diff changeset
128 cascade harmlessly. */
1480
1f41e5921090 input buffering
Franklin Schmidt <fschmidt@gmail.com>
parents: 1479
diff changeset
129 if (len >= buf.length) {
1f41e5921090 input buffering
Franklin Schmidt <fschmidt@gmail.com>
parents: 1479
diff changeset
130 return super.read(b, off, len);
1479
Franklin Schmidt <fschmidt@gmail.com>
parents: 1478
diff changeset
131 }
Franklin Schmidt <fschmidt@gmail.com>
parents: 1478
diff changeset
132 fill();
Franklin Schmidt <fschmidt@gmail.com>
parents: 1478
diff changeset
133 avail = count - pos;
Franklin Schmidt <fschmidt@gmail.com>
parents: 1478
diff changeset
134 if (avail <= 0) return -1;
Franklin Schmidt <fschmidt@gmail.com>
parents: 1478
diff changeset
135 }
Franklin Schmidt <fschmidt@gmail.com>
parents: 1478
diff changeset
136 int cnt = (avail < len) ? avail : len;
1480
1f41e5921090 input buffering
Franklin Schmidt <fschmidt@gmail.com>
parents: 1479
diff changeset
137 System.arraycopy(buf, pos, b, off, cnt);
1479
Franklin Schmidt <fschmidt@gmail.com>
parents: 1478
diff changeset
138 pos += cnt;
Franklin Schmidt <fschmidt@gmail.com>
parents: 1478
diff changeset
139 return cnt;
Franklin Schmidt <fschmidt@gmail.com>
parents: 1478
diff changeset
140 }
1478
37e582f2e266 clone BufferedInputStream
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
141
1479
Franklin Schmidt <fschmidt@gmail.com>
parents: 1478
diff changeset
142 /**
Franklin Schmidt <fschmidt@gmail.com>
parents: 1478
diff changeset
143 * See the general contract of the <code>skip</code>
Franklin Schmidt <fschmidt@gmail.com>
parents: 1478
diff changeset
144 * method of <code>InputStream</code>.
Franklin Schmidt <fschmidt@gmail.com>
parents: 1478
diff changeset
145 *
Franklin Schmidt <fschmidt@gmail.com>
parents: 1478
diff changeset
146 * @exception IOException if the stream does not support seek,
Franklin Schmidt <fschmidt@gmail.com>
parents: 1478
diff changeset
147 * or if this input stream has been closed by
Franklin Schmidt <fschmidt@gmail.com>
parents: 1478
diff changeset
148 * invoking its {@link #close()} method, or an
Franklin Schmidt <fschmidt@gmail.com>
parents: 1478
diff changeset
149 * I/O error occurs.
Franklin Schmidt <fschmidt@gmail.com>
parents: 1478
diff changeset
150 */
Franklin Schmidt <fschmidt@gmail.com>
parents: 1478
diff changeset
151 public synchronized long skip(long n) throws IOException {
Franklin Schmidt <fschmidt@gmail.com>
parents: 1478
diff changeset
152 long avail = count - pos;
Franklin Schmidt <fschmidt@gmail.com>
parents: 1478
diff changeset
153 if (avail <= 0) {
1480
1f41e5921090 input buffering
Franklin Schmidt <fschmidt@gmail.com>
parents: 1479
diff changeset
154 return super.skip(n);
1479
Franklin Schmidt <fschmidt@gmail.com>
parents: 1478
diff changeset
155 }
Franklin Schmidt <fschmidt@gmail.com>
parents: 1478
diff changeset
156 long skipped = (avail < n) ? avail : n;
Franklin Schmidt <fschmidt@gmail.com>
parents: 1478
diff changeset
157 pos += skipped;
Franklin Schmidt <fschmidt@gmail.com>
parents: 1478
diff changeset
158 return skipped;
Franklin Schmidt <fschmidt@gmail.com>
parents: 1478
diff changeset
159 }
1478
37e582f2e266 clone BufferedInputStream
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
160
1479
Franklin Schmidt <fschmidt@gmail.com>
parents: 1478
diff changeset
161 /**
Franklin Schmidt <fschmidt@gmail.com>
parents: 1478
diff changeset
162 * Returns an estimate of the number of bytes that can be read (or
Franklin Schmidt <fschmidt@gmail.com>
parents: 1478
diff changeset
163 * skipped over) from this input stream without blocking by the next
Franklin Schmidt <fschmidt@gmail.com>
parents: 1478
diff changeset
164 * invocation of a method for this input stream. The next invocation might be
Franklin Schmidt <fschmidt@gmail.com>
parents: 1478
diff changeset
165 * the same thread or another thread. A single read or skip of this
Franklin Schmidt <fschmidt@gmail.com>
parents: 1478
diff changeset
166 * many bytes will not block, but may read or skip fewer bytes.
Franklin Schmidt <fschmidt@gmail.com>
parents: 1478
diff changeset
167 * <p>
Franklin Schmidt <fschmidt@gmail.com>
parents: 1478
diff changeset
168 * This method returns the sum of the number of bytes remaining to be read in
Franklin Schmidt <fschmidt@gmail.com>
parents: 1478
diff changeset
169 * the buffer (<code>count&nbsp;- pos</code>) and the result of calling the
Franklin Schmidt <fschmidt@gmail.com>
parents: 1478
diff changeset
170 * {@link java.io.FilterInputStream#in in}.available().
Franklin Schmidt <fschmidt@gmail.com>
parents: 1478
diff changeset
171 *
Franklin Schmidt <fschmidt@gmail.com>
parents: 1478
diff changeset
172 * @return an estimate of the number of bytes that can be read (or skipped
Franklin Schmidt <fschmidt@gmail.com>
parents: 1478
diff changeset
173 * over) from this input stream without blocking.
Franklin Schmidt <fschmidt@gmail.com>
parents: 1478
diff changeset
174 * @exception IOException if this input stream has been closed by
Franklin Schmidt <fschmidt@gmail.com>
parents: 1478
diff changeset
175 * invoking its {@link #close()} method,
Franklin Schmidt <fschmidt@gmail.com>
parents: 1478
diff changeset
176 * or an I/O error occurs.
Franklin Schmidt <fschmidt@gmail.com>
parents: 1478
diff changeset
177 */
Franklin Schmidt <fschmidt@gmail.com>
parents: 1478
diff changeset
178 public synchronized int available() throws IOException {
Franklin Schmidt <fschmidt@gmail.com>
parents: 1478
diff changeset
179 int n = count - pos;
1480
1f41e5921090 input buffering
Franklin Schmidt <fschmidt@gmail.com>
parents: 1479
diff changeset
180 int avail = super.available();
1479
Franklin Schmidt <fschmidt@gmail.com>
parents: 1478
diff changeset
181 return n > (Integer.MAX_VALUE - avail)
Franklin Schmidt <fschmidt@gmail.com>
parents: 1478
diff changeset
182 ? Integer.MAX_VALUE
Franklin Schmidt <fschmidt@gmail.com>
parents: 1478
diff changeset
183 : n + avail;
Franklin Schmidt <fschmidt@gmail.com>
parents: 1478
diff changeset
184 }
1478
37e582f2e266 clone BufferedInputStream
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
185
1480
1f41e5921090 input buffering
Franklin Schmidt <fschmidt@gmail.com>
parents: 1479
diff changeset
186 public void mark(int readlimit) {}
1f41e5921090 input buffering
Franklin Schmidt <fschmidt@gmail.com>
parents: 1479
diff changeset
187
1f41e5921090 input buffering
Franklin Schmidt <fschmidt@gmail.com>
parents: 1479
diff changeset
188 public void reset() throws IOException {
1f41e5921090 input buffering
Franklin Schmidt <fschmidt@gmail.com>
parents: 1479
diff changeset
189 throw new IOException("mark/reset not supported");
1479
Franklin Schmidt <fschmidt@gmail.com>
parents: 1478
diff changeset
190 }
1478
37e582f2e266 clone BufferedInputStream
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
191
1479
Franklin Schmidt <fschmidt@gmail.com>
parents: 1478
diff changeset
192 public boolean markSupported() {
1480
1f41e5921090 input buffering
Franklin Schmidt <fschmidt@gmail.com>
parents: 1479
diff changeset
193 return false;
1479
Franklin Schmidt <fschmidt@gmail.com>
parents: 1478
diff changeset
194 }
1478
37e582f2e266 clone BufferedInputStream
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
195
37e582f2e266 clone BufferedInputStream
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
196 }