-
Notifications
You must be signed in to change notification settings - Fork 75
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
56 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
rules/rules-reviewed/cloud-readiness/tests/data/CommonIO.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import org.apache.commons.io.input.TeeInputStream; | ||
import org.apache.commons.io.output.ByteArrayOutputStream; | ||
import org.apache.commons.io.output.TeeOutputStream; | ||
|
||
public class CommonsIO { | ||
|
||
public static void main(String[] args) throws IOException { | ||
String str = "Hello World."; | ||
ByteArrayInputStream inputStream = new ByteArrayInputStream(str.getBytes()); | ||
ByteArrayOutputStream outputStream1 = new ByteArrayOutputStream(); | ||
ByteArrayOutputStream outputStream2 = new ByteArrayOutputStream(); | ||
|
||
FilterOutputStream teeOutputStream | ||
= new TeeOutputStream(outputStream1, outputStream2); | ||
new TeeInputStream(inputStream, teeOutputStream, true).read(new byte[str.length()]); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters