google / google/error-prone

{Byte,Char}{Source,Sink} in Guava should generate new streams each time

Open
#133 0 comments 0 reactions 0 assignees View on GitHub
migrated Priority-Medium Type-NewCheck
Dominant language
Java
Stars
7.2k
Forks
820
Avg merge
5h 9m
Merged PRs (30d)
50

Description

_[Original issue](https://code.google.com/p/error-prone/issues/detail?id=133) created by **lowasser@google.com** on 2013-05-24 at 06:16 PM_

---

In Guava, the {Byte,Char}{Source,Sink} APIs are intended to allow you to operate fluently on a stream by opening it, operating on it, and closing it without ever letting the user get access to the stream -- so they don't have to remember to close it or not.

A sample misuse would be

```
return new ByteSource() {
@Override
public InputStream openStream() {
return stream;
}
}.read();
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.