MCPcopy Index your code
hub / github.com/apache/groovy / makeRepeatFasta

Method makeRepeatFasta

benchmark/bench/fasta.java:103–126  ·  view source on GitHub ↗
(String id, String desc, String alu, int n, OutputStream writer)

Source from the content-addressed store, hash-verified

101 }
102
103 static final void makeRepeatFasta(String id, String desc, String alu, int n, OutputStream writer) throws IOException
104 {
105 index = 0;
106 int m = 0;
107 int k = 0;
108 int kn = ALUB.length;
109 String descStr = ">" + id + " " + desc + '\n';
110 writer.write(descStr.getBytes());
111 while (n > 0) {
112 if (n < LINE_LENGTH) m = n; else m = LINE_LENGTH;
113 if(BUFFER_SIZE - index < m){
114 writer.write(bbuffer, 0, index);
115 index = 0;
116 }
117 for (int i = 0; i < m; i++) {
118 if (k == kn) k = 0;
119 bbuffer[index++] = ALUB[k];
120 k++;
121 }
122 bbuffer[index++] = '\n';
123 n -= LINE_LENGTH;
124 }
125 if(index != 0) writer.write(bbuffer, 0, index);
126 }
127
128 public static void main(String[] args) throws IOException {
129 makeCumulative(HomoSapiens);

Callers 1

mainMethod · 0.95

Calls 2

writeMethod · 0.65
getBytesMethod · 0.45

Tested by

no test coverage detected