- package com.dev.concurrent;
- import java.io.FileInputStream;
- import java.io.FileOutputStream;
- import java.io.IOException;
- /**
- * File to File Copy using Java Streams.
- *
- */
- public class StreamExample
- {
- public void byteStreamExample() {
- try(FileInputStream in = new FileInputStream("samplein.txt")) {
- try (FileOutputStream out = new FileOutputStream("sampleout.txt")) {
- int c;
- while ((c = in.read()) != -1) {
- out.write(c);
- }
- }catch (IOException e) {
- e.printStackTrace();
- }
- } catch (IOException e) {
- e.printStackTrace();
- }
- }
- public static void main(String[] args)
- {
- StreamExample se = new StreamExample() ;
- se.byteStreamExample() ;
- }
- }
File to File Copy Using Java Streams
Subscribe to:
Post Comments (Atom)
Could not find method signingConfigs() for arguments
Could not find method signingConfigs() for arguments [build_5dw7nwfc8ibd8sagvx4p79x1u$_run_closure5@13e86039] on root project 'android...

No comments:
Post a Comment