package innovimax.mixthem.operation;

import innovimax.mixthem.io.DefaultCharReader;
import innovimax.mixthem.io.DefaultCharWriter;
import innovimax.mixthem.io.ICharInput;
import innovimax.mixthem.io.ICharOutput;
import innovimax.mixthem.io.InputResource;

import java.io.IOException;
import java.io.OutputStream;

/**
* <p>Copy all characters.</p>
* @author Innovimax
* @version 1.0
*/
public class DefaultCharCopy extends AbstractCopy {

    private final static int CHAR_BUFFER_SIZE = 1024;
    
    /**
	* Constructor	
 	* @param params The list of parameters (maybe empty)
	* @see innovimax.mixthem.arguments.RuleParam
	* @see innovimax.mixthem.arguments.ParamValue
	*/
	public DefaultCharCopy(final Map<RuleParam, ParamValue> params) {
		super(params);		
	}
    
    @Override
    public void processFile(InputResource input, OutputStream out) throws IOException {
        char[] buffer = new char[CHAR_BUFFER_SIZE];
        ICharInput reader = new DefaultCharReader(input);
        ICharOutput writer = new DefaultCharWriter(out);
        while (reader.hasCharacter()) {
            final int len = reader.nextCharacters(buffer, CHAR_BUFFER_SIZE);
            writer.writeCharacters(buffer, len);
        }
        reader.close();
        writer.close();
    }    
    
}

@@ -433,20 +433,17 @@
 Copy %7B%0A%0A
-    
+%09
 private 
@@ -484,25 +484,19 @@
 = 1024;%0A
-    %0A    
+%09%0A%09
 /**%0A%09* C
@@ -748,25 +748,19 @@
 );%09%09%0A%09%7D%0A
-    %0A    
+%09%0A%09
 @Overrid
@@ -761,20 +761,17 @@
 verride%0A
-    
+%09
 public v
@@ -846,24 +846,18 @@
 ption %7B%0A
-        
+%09%09
 char%5B%5D b
@@ -892,24 +892,18 @@
 _SIZE%5D;%0A
-        
+%09%09
 ICharInp
@@ -944,24 +944,18 @@
 input);%0A
-        
+%09%09
 ICharOut
@@ -995,24 +995,18 @@
 r(out);%0A
-        
+%09%09
 while (r
@@ -1029,28 +1029,19 @@
 er()) %7B%0A
-            
+%09%09%09
 final in
@@ -1101,20 +1101,11 @@
 E);%0A
-            
+%09%09%09
 writ
@@ -1141,26 +1141,14 @@
 n);%0A
-        %7D%0A        
+%09%09%7D%0A%09%09
 read
@@ -1163,16 +1163,10 @@
 ();%0A
-        
+%09%09
 writ
@@ -1181,21 +1181,14 @@
 ();%0A
-    
+%09
 %7D    %0A
-    
 %0A%7D%0A

Update DefaultCharCopy.java