X-Received: by 10.224.213.197 with SMTP id gx5mr17474374qab.8.1362511238221; Tue, 05 Mar 2013 11:20:38 -0800 (PST) X-Received: by 10.49.25.13 with SMTP id y13mr2119125qef.2.1362511238179; Tue, 05 Mar 2013 11:20:38 -0800 (PST) Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!news.glorb.com!t2no9104234qal.0!news-out.google.com!q17ni604qal.0!nntp.google.com!dd2no7269920qab.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.java.programmer Date: Tue, 5 Mar 2013 11:20:38 -0800 (PST) In-Reply-To: <026b0609-ef87-470e-b899-fc00529bb4ce@googlegroups.com> Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=188.155.87.251; posting-account=UdjKVQkAAADdwjjAc7pI5-Sjpc8eLCsJ NNTP-Posting-Host: 188.155.87.251 References: <026b0609-ef87-470e-b899-fc00529bb4ce@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <629a4687-24e7-49cc-b8b0-e7f91fbf79bd@googlegroups.com> Subject: Re: hello here is a copy of a copy program on the net . From: giovannich1965@gmail.com Injection-Date: Tue, 05 Mar 2013 19:20:38 +0000 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Xref: csiph.com comp.lang.java.programmer:22730 thank you display is just a control to see if read but if I wanted to see how hexaa instead of decimal? And how to change the value read for example by inverting the value? b [i] =3D - (b [i]); Le mardi 5 mars 2013 17:44:01 UTC+1, giovann...@gmail.com a =E9crit=A0: > .. but I can not see a byte that download ...=20 >=20 > it displays this: [B @ 1f33675 >=20 > =A0 continuously .... until the end >=20 >=20 >=20 > if you can help me thank you ... >=20 >=20 >=20 > package fichier; >=20 >=20 >=20 > import java.io.FileNotFoundException; >=20 > import java.io.FileInputStream; >=20 > import java.io.FileOutputStream; >=20 > import java.io.IOException; >=20 > =20 >=20 > =20 >=20 > public class fichier { >=20 > =20 >=20 > public static void main(String[] args) { >=20 > =20 >=20 > String strSourceFile=3D"C:/temp/demo.txt"; >=20 > String strDestinationFile=3D"C:/temp/demo2.txt"; >=20 > =20 >=20 > try >=20 > { >=20 > //create FileInputStream object for source file >=20 > FileInputStream fin =3D new FileInputStream(strSo= urceFile); >=20 > =20 >=20 > //create FileOutputStream object for destination = file >=20 > FileOutputStream fout =3D new FileOutputStream(st= rDestinationFile); >=20 > =20 >=20 > byte[] b =3D new byte[2]; >=20 > int noOfBytes =3D 0; >=20 > =20 >=20 > System.out.println("Copying file using streams"); >=20 > =20 >=20 > //read bytes from source file and write to destin= ation file >=20 > while( (noOfBytes =3D fin.read(b)) !=3D -1 ) >=20 > { >=20 > System.out.println(b); >=20 > fout.write(b, 0, noOfBytes); >=20 > } >=20 > =20 >=20 > System.out.println("File copied!"); >=20 > =20 >=20 > //close the streams >=20 > fin.close(); >=20 > fout.close(); =20 >=20 > =20 >=20 > } >=20 > catch(FileNotFoundException fnf) >=20 > { >=20 > System.out.println("Specified file not found :" += fnf); >=20 > } >=20 > catch(IOException ioe) >=20 > { >=20 > System.out.println("Error while copying file :" += ioe); >=20 > } >=20 > } >=20 > } >=20 > =20 >=20 > /* >=20 > Typical output would be >=20 > Copying file using streams >=20 > File copied! >=20 > */