<dependencies> <dependency> <groupId>org.example</groupId> <artifactId>readable-stream</artifactId> <version>1.0.0</version> </dependency> </dependencies> import org.example.readablestream.ReadableStream; import java.io.File; public class Main { public static void main(String[] args) { File file = new File("data.txt"); ReadableStream stream = new ReadableStream(file); // ... } } import org.example.readablestream.ReadableStream; public class Main { public static void main(String[] args) { stream.onData((data) -> { System.out.println(data); }); stream.onEnd(() -> { }); } }


上一篇:
下一篇:
切换中文