Skip to content

Commit 4114db4

Browse files
authored
limit public API to enhance evolvability in future (#538)
1 parent f43cc9c commit 4114db4

1 file changed

Lines changed: 7 additions & 7 deletions

File tree

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

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
/**
3030
* Provides bandwidth throttling on a specified InputStream. It is implemented as a wrapper on top of another InputStream instance. The throttling works by
3131
* examining the number of bytes read from the underlying InputStream from the beginning, and sleep()ing for a time interval if the byte-transfer is found
32-
* exceed the specified tolerable maximum. (Thus, while the read-rate might exceed the maximum for a given short interval, the average tends towards the
32+
* exceed the specified tolerable maximum. (Thus, while the read-rate might exceed the maximum for a short interval, the average tends towards the
3333
* specified maximum, overall.)
3434
* <p>
3535
* Inspired by Apache HBase's class of the same name.
@@ -40,23 +40,23 @@
4040
public final class ThrottledInputStream extends CountingInputStream {
4141

4242
/**
43-
* Builds a new {@link QueueInputStream} instance.
43+
* Builds a new {@link ThrottledInputStream} instance.
4444
* <h2>Using NIO</h2>
4545
*
4646
* <pre>{@code
47-
* ThrottledInputStream s = ThrottledInputStream.builder().setPath(Paths.get("MyFile.xml")).setMaxBytesPerSecond(100_000).get();
47+
* ThrottledInputStream in = ThrottledInputStream.builder().setPath(Paths.get("MyFile.xml")).setMaxBytesPerSecond(100_000).get();
4848
* }
4949
* </pre>
5050
*
5151
* <h2>Using IO</h2>
5252
*
5353
* <pre>{@code
54-
* ThrottledInputStream s = ThrottledInputStream.builder().setFile(new File("MyFile.xml")).setMaxBytesPerSecond(100_000).get();
54+
* ThrottledInputStream in = ThrottledInputStream.builder().setFile(new File("MyFile.xml")).setMaxBytesPerSecond(100_000).get();
5555
* }
5656
* </pre>
5757
*
5858
* <pre>{@code
59-
* ThrottledInputStream s = ThrottledInputStream.builder().setInputStream(inputStream).setMaxBytesPerSecond(100_000).get();
59+
* ThrottledInputStream in = ThrottledInputStream.builder().setInputStream(inputStream).setMaxBytesPerSecond(100_000).get();
6060
* }
6161
* </pre>
6262
*/
@@ -123,7 +123,7 @@ private ThrottledInputStream(final InputStream proxy, final long maxBytesPerSeco
123123
*
124124
* @return Read rate, in bytes/sec.
125125
*/
126-
public long getBytesPerSecond() {
126+
private long getBytesPerSecond() {
127127
final long elapsedSeconds = (System.currentTimeMillis() - startTime) / 1000;
128128
if (elapsedSeconds == 0) {
129129
return getByteCount();
@@ -140,7 +140,7 @@ private long getSleepMillis() {
140140
*
141141
* @return Duration spent in sleep.
142142
*/
143-
public Duration getTotalSleepDuration() {
143+
Duration getTotalSleepDuration() {
144144
return totalSleepDuration;
145145
}
146146

0 commit comments

Comments
 (0)