Thank 4 share.
I'm new menber
View more random threads:
- try, catch and finally block?
- how PageSpeed Insights works for your page analysis breif...
- Java 6 update 26 - incompatible! Bis
- how to set path in Java 2011
- How can I deploy an app that uses JOGL (so is platform...
- is java a throughly OOP
- Netbeans md3 is f9a89a8e5f3ce4387c614e1466977b85
- what is garbage collection
- Deployment Flow / Process from netBean IDE to tomcat...
- Event Handling in java
Code:package main; import java.io.BufferedInputStream; import java.io.BufferedOutputStream; import java.io.File; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.IOException; public class DataSendTester { public static void main( String[] args ) { File testF = new File( "test.jpg" ); File result = new File( "TEST/testImg.jpg" ); try { System.out.println( "Writing..." ); BufferedInputStream in = new BufferedInputStream( new FileInputStream( testF ) ); BufferedOutputStream out = new BufferedOutputStream( new FileOutputStream( result ) ); byte[] buffer = new byte[ 4096 ]; int bytesRead; while ( (bytesRead = in.read( buffer )) != -1 ) { out.write( buffer, 0, bytesRead ); } out.flush(); out.close(); System.out.println( "Done." ); } catch ( FileNotFoundException e ) { e.printStackTrace(); } catch ( IOException e ) { e.printStackTrace(); } } }
Sponsored Links
Thank 4 share.
I'm new menber
There are currently 1 users browsing this thread. (0 members and 1 guests)