public void writeTo ( OutputStream target ) throws IOException { this . data . close ( ) ; BufferedInputStream tempIn = new BufferedInputStream ( new FileInputStream ( this . tempFile ) ) ; byte [ ] buffer = new byte [ 8192 ] ; int bytesRead = - 1 ; while ( ( bytesRead = tempIn . read ( buffer ) ) >= 0 ) { target . write ( buffer , 0 , bytesRead ) ; } tempIn . close ( ) ; this . tempFile . delete ( ) ; }
Writes the content of the temporary file into the OutputStream .