import java.io.DataInputStream; import java.io.DataOutputStream; import java.io.FileInputStream; import java.io.FileOutputStream; public class Homotetie { public static void main(String[] args) { try { FileInputStream fi = new FileInputStream("polygone.bin"); DataInputStream dis = new DataInputStream(fi); FileOutputStream fo = new FileOutputStream("polygonex2.bin"); DataOutputStream dos = new DataOutputStream(fo); int n = dis.available() / 8; for (int i = 0; i < n; i++) { dos.writeInt(dis.readInt() * 2); } dis.close(); dos.close(); } catch (Exception e) { } } }