commit 08714be4b3f5be8c3b580f3c72cfea1f921c3138 Author: kevin Date: Tue Nov 8 17:35:56 2022 +0100 Actividad6 MyCopy diff --git a/.project b/.project new file mode 100644 index 0000000..ccfdf3c --- /dev/null +++ b/.project @@ -0,0 +1,17 @@ + + + myCopy + + + + + + org.eclipse.jdt.core.javabuilder + + + + + + org.eclipse.jdt.core.javanature + + diff --git a/.settings/org.eclipse.core.resources.prefs b/.settings/org.eclipse.core.resources.prefs new file mode 100644 index 0000000..99f26c0 --- /dev/null +++ b/.settings/org.eclipse.core.resources.prefs @@ -0,0 +1,2 @@ +eclipse.preferences.version=1 +encoding/=UTF-8 diff --git a/.settings/org.eclipse.jdt.core.prefs b/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 0000000..8c9943d --- /dev/null +++ b/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,14 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.targetPlatform=17 +org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve +org.eclipse.jdt.core.compiler.compliance=17 +org.eclipse.jdt.core.compiler.debug.lineNumber=generate +org.eclipse.jdt.core.compiler.debug.localVariable=generate +org.eclipse.jdt.core.compiler.debug.sourceFile=generate +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning +org.eclipse.jdt.core.compiler.release=enabled +org.eclipse.jdt.core.compiler.source=17 diff --git a/FicheroDestino.txt.txt b/FicheroDestino.txt.txt new file mode 100644 index 0000000..e69de29 diff --git a/FicheroOrigen.txt.txt b/FicheroOrigen.txt.txt new file mode 100644 index 0000000..9f2c5da --- /dev/null +++ b/FicheroOrigen.txt.txt @@ -0,0 +1 @@ +Hola esto es una prueba de la copia diff --git a/bin/dam/com/es/MyCopy.class b/bin/dam/com/es/MyCopy.class new file mode 100644 index 0000000..8210854 Binary files /dev/null and b/bin/dam/com/es/MyCopy.class differ diff --git a/bin/module-info.class b/bin/module-info.class new file mode 100644 index 0000000..c28793e Binary files /dev/null and b/bin/module-info.class differ diff --git a/src/dam/com/es/MyCopy.java b/src/dam/com/es/MyCopy.java new file mode 100644 index 0000000..6164e2c --- /dev/null +++ b/src/dam/com/es/MyCopy.java @@ -0,0 +1,44 @@ +package dam.com.es; + + +import java.io.File; +import java.io.FileInputStream; +import java.io.FileNotFoundException; +import java.io.IOException; + +import java.io.FileOutputStream; + + +public class MyCopy { + + public static void main(String [] args) + throws FileNotFoundException, IOException, InterruptedException{ + + + File copy = new File("FicheroOrigen.txt.txt"); + + FileInputStream in = new FileInputStream(copy); + FileOutputStream out = new FileOutputStream("C:\\Users\\kevin\\MyCopy\\FicheroDestino.txt"); + + int n=0; + + System.out.println ("\nCopiando ..."); + System.out.print ("["); + byte[] completo = in.readAllBytes(); + for(int i =0; i