Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
util-core: Introduce Reader.readAllItems for generic types
Problem: Reader.readAll was Buf biased, and it should be in BufReader. Solution: Move `readAll(r: Reader[Buf])` to `BufReader`, while introduce `readAllItems[A](r: Reader[A])` to the `Reader` object. JIRA Issues: CSL-8869 Differential Revision: https://phabricator.twitter.biz/D391346
- Loading branch information
Showing
11 changed files
with
113 additions
and
59 deletions.
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
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,23 @@ | ||
package com.twitter.io; | ||
|
||
import com.twitter.util.Future; | ||
|
||
/** | ||
* Better Java APIs of BufReader for Scala 2.11. | ||
* This will be removed when drop Scala 2.11 support. | ||
* | ||
* @see com.twitter.io.BufReader | ||
*/ | ||
public final class BufReaders { | ||
|
||
private BufReaders() { | ||
throw new IllegalStateException(); | ||
} | ||
|
||
/** | ||
* See {@code com.twitter.io.BufReader.readAll}. | ||
*/ | ||
public static Future<Buf> readAll(Reader<Buf> r) { | ||
return BufReader$.MODULE$.readAll(r); | ||
} | ||
} |
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
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
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
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
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
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
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
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
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