| @ -0,0 +1,10 @@ | |||||
| <?xml version="1.0" encoding="UTF-8"?> | |||||
| <classpath> | |||||
| <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-17"> | |||||
| <attributes> | |||||
| <attribute name="module" value="true"/> | |||||
| </attributes> | |||||
| </classpathentry> | |||||
| <classpathentry kind="src" path="src"/> | |||||
| <classpathentry kind="output" path="bin"/> | |||||
| </classpath> | |||||
| @ -0,0 +1,17 @@ | |||||
| <?xml version="1.0" encoding="UTF-8"?> | |||||
| <projectDescription> | |||||
| <name>MiCopia</name> | |||||
| <comment></comment> | |||||
| <projects> | |||||
| </projects> | |||||
| <buildSpec> | |||||
| <buildCommand> | |||||
| <name>org.eclipse.jdt.core.javabuilder</name> | |||||
| <arguments> | |||||
| </arguments> | |||||
| </buildCommand> | |||||
| </buildSpec> | |||||
| <natures> | |||||
| <nature>org.eclipse.jdt.core.javanature</nature> | |||||
| </natures> | |||||
| </projectDescription> | |||||
| @ -0,0 +1,2 @@ | |||||
| eclipse.preferences.version=1 | |||||
| encoding/<project>=UTF-8 | |||||
| @ -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 | |||||
| @ -0,0 +1,13 @@ | |||||
| HACE UNA COPIA DE UN TXT Y GUARDARLOS EN OTRO. | |||||
| Lo primero que tenemos que hacer es un coger la ruta del primer archivo. | |||||
| Luego crearemos el leer archivo y donde lo queremos escribir. | |||||
| Guardaremos los datos en un array de Byte. | |||||
| Y ya empezamos el proceso de copia con un For. | |||||
| Y ya estaria. | |||||
| ``` | |||||
| Empezando el proceso de copia. Sea paciente por favor. | |||||
| (------------------) | |||||
| Enhorabuena, su copia ha sido realizada con éxito. | |||||
| ``` | |||||
| @ -0,0 +1,36 @@ | |||||
| package com.cristobalbernal.MiCopia; | |||||
| import java.io.FileInputStream; | |||||
| import java.io.FileOutputStream; | |||||
| import java.io.IOException; | |||||
| public class MiCopia { | |||||
| public static void main(String[] args) throws InterruptedException { | |||||
| byte[] datos; | |||||
| String ruta = "C:\\Users\\crist\\Documents\\2DAM\\BaseDeDatos\\Prueba.txt"; | |||||
| try { | |||||
| FileInputStream leerArchivo = new FileInputStream(ruta); | |||||
| FileOutputStream escrito =new FileOutputStream("C:\\Users\\crist\\Documents\\2DAM\\BaseDeDatos\\Resultado.txt"); | |||||
| datos = leerArchivo.readAllBytes(); | |||||
| System.out.println("Empezando el proceso de copia. Sea paciente por favor."); | |||||
| Thread.sleep(1500); | |||||
| System.out.print("("); | |||||
| for(int i =0; i<datos.length; i++) { | |||||
| Thread.sleep(300); | |||||
| System.out.print("-"); | |||||
| escrito.write(datos[i]); | |||||
| } | |||||
| System.out.println(")"); | |||||
| Thread.sleep(1000); | |||||
| System.out.println("Enhorabuena, su copia ha sido realizada con éxito."); | |||||
| }catch (IOException e) { | |||||
| e.printStackTrace(); | |||||
| } | |||||
| } | |||||
| } | |||||
| @ -0,0 +1 @@ | |||||
| package com.cristobalbernal.MiCopia; | |||||
| @ -0,0 +1,9 @@ | |||||
| /** | |||||
| * | |||||
| */ | |||||
| /** | |||||
| * @author crist | |||||
| * | |||||
| */ | |||||
| module MiCopia { | |||||
| } | |||||