!str - 18916 - Source.file and Sink.file
* Removes `Synchronous` from the names and descriptions of File I/O as it leaks impl details * Removes the factries for FileSource and FileSink and puts them in Source and Sink respectively
This commit is contained in:
parent
7d4304fc6e
commit
20c996fe41
31 changed files with 262 additions and 242 deletions
|
|
@ -6,11 +6,14 @@ import akka.japi.Pair;
|
|||
import akka.japi.function.Function;
|
||||
import akka.stream.*;
|
||||
import akka.stream.javadsl.*;
|
||||
import akka.util.ByteString;
|
||||
import scala.Option;
|
||||
import scala.concurrent.Future;
|
||||
import scala.concurrent.duration.FiniteDuration;
|
||||
import scala.concurrent.Promise;
|
||||
import scala.runtime.BoxedUnit;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import java.nio.charset.Charset;
|
||||
|
||||
|
|
@ -146,6 +149,17 @@ public class MigrationsJava {
|
|||
//#query-param
|
||||
final akka.japi.Option<String> aQueryParam = uri.query().get("a");
|
||||
//#query-param
|
||||
|
||||
//#file-source-sink
|
||||
final Source<ByteString, Future<Long>> fileSrc =
|
||||
Source.file(new File("."));
|
||||
|
||||
final Source<ByteString, Future<Long>> otherFileSrc =
|
||||
Source.file(new File("."), 1024);
|
||||
|
||||
final Sink<ByteString, Future<Long>> fileSink =
|
||||
Sink.file(new File("."));
|
||||
//#file-source-sink
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue