Skip to content

Commit 713e964

Browse files
committed
Internal reuse
1 parent d0c53cd commit 713e964

1 file changed

Lines changed: 7 additions & 8 deletions

File tree

src/main/java/org/apache/commons/io/input/BoundedInputStream.java

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -143,30 +143,29 @@ public BoundedInputStream(final InputStream in) {
143143
* Constructs a new {@link BoundedInputStream} that wraps the given input stream and limits it to a certain size.
144144
*
145145
* @param inputStream The wrapped input stream.
146-
* @param maxLength The maximum number of bytes to return.
146+
* @param maxCount The maximum number of bytes to return.
147147
* @deprecated Use {@link Builder#get()}.
148148
*/
149149
@Deprecated
150-
public BoundedInputStream(final InputStream inputStream, final long maxLength) {
151-
// Some badly designed methods - e.g. the servlet API - overload length
150+
public BoundedInputStream(final InputStream inputStream, final long maxCount) {
151+
// Some badly designed methods - e.g. the Servlet API - overload length
152152
// such that "-1" means stream finished
153-
super(inputStream);
154-
this.maxCount = maxLength;
153+
this(inputStream, maxCount, true);
155154
}
156155

157156
/**
158157
* Constructs a new {@link BoundedInputStream} that wraps the given input stream and limits it to a certain size.
159158
*
160159
* @param inputStream The wrapped input stream.
161-
* @param maxLength The maximum number of bytes to return.
160+
* @param maxCount The maximum number of bytes to return.
162161
* @param propagateClose {@code true} if calling {@link #close()} propagates to the {@code close()} method of the underlying stream or {@code false} if it
163162
* does not.
164163
*/
165-
private BoundedInputStream(final InputStream inputStream, final long maxLength, final boolean propagateClose) {
164+
private BoundedInputStream(final InputStream inputStream, final long maxCount, final boolean propagateClose) {
166165
// Some badly designed methods - e.g. the Servlet API - overload length
167166
// such that "-1" means stream finished
168167
super(inputStream);
169-
this.maxCount = maxLength;
168+
this.maxCount = maxCount;
170169
this.propagateClose = propagateClose;
171170
}
172171

0 commit comments

Comments
 (0)