Skip to content

Commit

Permalink
yegor256#123: fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
yegor256 committed Jun 13, 2017
1 parent b1f65f2 commit 2e988e9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/main/java/org/cactoos/io/InputAsBytes.java
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,11 @@ public InputAsBytes(final Input input, final int max) {

@Override
public byte[] asBytes() throws IOException {
try (final ByteArrayOutputStream baos = new ByteArrayOutputStream()) {
try (final ByteArrayOutputStream baos = new ByteArrayOutputStream();
final InputStream stream = new TeeInput(
this.source,
new OutputStreamAsOutput(baos)
).stream();
).stream()) {
final byte[] buf = new byte[this.size];
while (true) {
if (stream.read(buf) != buf.length) {
Expand Down
1 change: 1 addition & 0 deletions src/test/java/org/cactoos/io/InputAsBytesTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
* @version $Id$
* @since 0.1
* @checkstyle JavadocMethodCheck (500 lines)
* @checkstyle ClassDataAbstractionCouplingCheck (500 lines)
*/
public final class InputAsBytesTest {

Expand Down

0 comments on commit 2e988e9

Please sign in to comment.