- 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() ;
- }
- }
{{theTime}}
Search This Blog
Total Pageviews
File to File Copy Using Java Streams
Subscribe to:
Post Comments (Atom)
Setup AWS Application Load Balancer Https
Setting up HTTPS for an AWS Application Load Balancer (ALB) involves configuring an HTTPS listener, deploying an SSL certificate, and defini...
No comments:
Post a Comment