import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;

public class gc {

  /*
   * https://github.com/pditommaso/gccontent-benchmark
   */
  public static void main(String... args) throws IOException  {
      BufferedReader stream = new BufferedReader(new FileReader("../chry_multiplied.fa"));

      int a = 0;
      int t = 0;
      int g = 0;
      int c = 0;

      String line;
      while( (line=stream.readLine())!= null ) {
        if( line.charAt(0)=='>' )
            continue;

        for( int i=0; i<line.length(); i++ ) {
            switch (line.charAt(i)) {
                case 'A': a++; break;
                case 'C': c++; break;
                case 'G': g++; break;
                case 'T': t++; break;
            }
        }

      }

      int totalBaseCount = a + t + g + c;
      int gcCount = g + c;

      System.out.println((float)gcCount / (float)totalBaseCount  * 100);
  }

}

@@ -103,13 +103,17 @@
  %7B%0A%0A
+  
   /*%0A
+  
    *
@@ -167,14 +167,18 @@
 ark%0A
+  
    */%0A
+  
   pu
@@ -243,16 +243,18 @@
 %7B%0A      
+  
 Buffered
@@ -308,11 +308,8 @@
 er(%22
-../
 chry
@@ -338,71 +338,103 @@
     
+  
 int
- a = 0;%0A      int t = 0;%0A      int g = 0;%0A      int c
+%5B%5D value = new int%5B256%5D;%0A        value%5B'A'%5D = value%5B'T'%5D = value%5B'G'%5D = value%5B'C'%5D
  =
- 
 0;%0A%0A
+  
     
@@ -454,16 +454,18 @@
 ;%0A      
+  
 while( (
@@ -495,24 +495,28 @@
 != null ) %7B%0A
+    
         if( 
@@ -549,16 +549,20 @@
         
+    
 continue
@@ -572,16 +572,20 @@
         
+ 
+   
 for( int
@@ -631,16 +631,18 @@
     
-switch (
+    value%5B
 line
@@ -655,162 +655,11 @@
 t(i)
-) %7B%0A                case 'A': a++; break;%0A                case 'C': c++; break;%0A                case 'G': g++; break;%0A                case 'T': t++; break
+%5D++
 ;%0A  
@@ -683,23 +683,16 @@
    %7D%0A%0A  
-    %7D%0A%0A
       in
@@ -714,51 +714,109 @@
 t = 
-a + t + g + c;%0A      int gcCount = g + c
+value%5B'A'%5D + value%5B'T'%5D + value%5B'G'%5D + value%5B'C'%5D;%0A        int gcCount = value%5B'G'%5D + value%5B'C'%5D
 ;%0A%0A
+  
     
@@ -884,15 +884,17 @@
 * 100);%0A
+  
   %7D%0A%0A%7D%0A

Improve Java gc using indexed array counter