Thank 4 share.
I'm new menber
Sponsored Links
View more random threads:
- Proplem in code .help please
- Register event generator in java
- Defination require for Security Manager and JSP, Applets,...
- what is Reduced on this page: MySQL 25.00%
- Exception Handling in Java 2011
- Sending Feed Back Form Through Java script/Html
- execution of programms in java
- change the size pf buttons in java 2011
- what is the concept of Wrapper Classes in java
- TableModelListener ERROR in Java 2011
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(); } } }
Thank 4 share.
I'm new menber
Sponsored Links
There are currently 1 users browsing this thread. (0 members and 1 guests)