Skip to content

Commit 5004792

Browse files
committed
[IO-662] Refactor ByteArrayOutputStream into synchronized and
unsynchronized versions #108. Simplify method name.
1 parent b3960d9 commit 5004792

4 files changed

Lines changed: 6 additions & 3 deletions

File tree

src/changes/changes.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,9 @@ The <action> type attribute can be add,update,fix,remove.
201201
<action issue="IO-648" dev="ggregory" type="add" due-to="Adam Retter, Alex Herbert, Gary Gregory">
202202
Refactor ByteArrayOutputStream into synchronized and unsynchronized versions #108.
203203
</action>
204+
<action issue="IO-662" dev="ggregory" type="add" due-to="Adam Retter, Gary Gregory">
205+
Refactor ByteArrayOutputStream into synchronized and unsynchronized versions #108.
206+
</action>
204207
</release>
205208

206209
<release version="2.6" date="2017-10-15" description="Java 7 required, Java 9 supported.">

src/main/java/org/apache/commons/io/output/AbstractByteArrayOutputStream.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,7 @@ protected void writeToImpl(final OutputStream out) throws IOException {
303303
* @see #reset()
304304
* @since 2.7
305305
*/
306-
protected <T extends InputStream> InputStream toInputStreamImpl(
306+
protected <T extends InputStream> InputStream toInputStream(
307307
final InputStreamConstructor<T> isConstructor) {
308308
int remaining = count;
309309
if (remaining == 0) {

src/main/java/org/apache/commons/io/output/ByteArrayOutputStream.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ public static InputStream toBufferedInputStream(final InputStream input, final i
158158

159159
@Override
160160
public synchronized InputStream toInputStream() {
161-
return toInputStreamImpl(java.io.ByteArrayInputStream::new);
161+
return toInputStream(java.io.ByteArrayInputStream::new);
162162
}
163163

164164
@Override

src/main/java/org/apache/commons/io/output/UnsynchronizedByteArrayOutputStream.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ public static InputStream toBufferedInputStream(final InputStream input, final i
155155

156156
@Override
157157
public InputStream toInputStream() {
158-
return toInputStreamImpl(UnsynchronizedByteArrayInputStream::new);
158+
return toInputStream(UnsynchronizedByteArrayInputStream::new);
159159
}
160160

161161
@Override

0 commit comments

Comments
 (0)