APL/APL2.1/TP14/Homotetie/Homotetie.java

26 lines
728 B
Java
Raw Permalink Normal View History

2022-05-23 16:20:43 +02:00
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) {
}
}
}