Skip to content
This repository has been archived by the owner on Jan 4, 2020. It is now read-only.

Commit

Permalink
fixed code example
Browse files Browse the repository at this point in the history
  • Loading branch information
Torsten Krause committed Apr 20, 2016
1 parent aebdab3 commit df96b45
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions README.MD
Original file line number Diff line number Diff line change
Expand Up @@ -86,14 +86,14 @@ fetcher.fetch(readable, appendable);
All methods have optional `boolean` parameters, that can be used to instruct the [`ByteFetcher`][ByteFetcher] or [`CharacterFetcher`][CharacterFetcher] to close the supplied streams. Doing so allows to write compact code like:

```java
foo.setContent(new BufferedFetcher().fetch(new FileInputStream(file), true));
foo.setContent(new BufferedByteFetcher().fetch(new FileInputStream(file), true));
```

Otherwise, it would be necessary to write unnecessarily verbose code like:

```java
InputStream in = new FileInputStream(file);
foo.setContent(new BufferedFetcher().fetch(in));
foo.setContent(new BufferedByteFetcher().fetch(in));
in.close();
```

Expand All @@ -102,7 +102,7 @@ in.close();
All methods optionally take a [`FetchProgressListener`][FetchProgressListener] that gets notified on various points in the lifecycle (`started`, `progressed`, `succeeded` or `failed`, `finished`) of a fetch operation. The [`BaseFetchProgressListener`][BaseFetchProgressListener] is a convenient base implementation with empty methods.

```java
foo.setContent(new BufferedFetcher().fetch(
foo.setContent(new BufferedByteFetcher().fetch(
new FileInputStream(file),
new BaseFetchProgressListener() {
public void onFetchProgress(long bytesFetched) {
Expand Down

0 comments on commit df96b45

Please sign in to comment.