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

Method makeRandomFasta

benchmark/bench/fasta.java:82–101  ·  view source on GitHub ↗
(String id, String desc,frequency[] a, int n, OutputStream writer)

Source from the content-addressed store, hash-verified

80 static int index = 0;
81 static byte[] bbuffer = new byte[BUFFER_SIZE];
82 static final void makeRandomFasta(String id, String desc,frequency[] a, int n, OutputStream writer) throws IOException
83 {
84 index = 0;
85 int m = 0;
86 String descStr = ">" + id + " " + desc + '\n';
87 writer.write(descStr.getBytes());
88 while (n > 0) {
89 if (n < LINE_LENGTH) m = n; else m = LINE_LENGTH;
90 if(BUFFER_SIZE - index < m){
91 writer.write(bbuffer, 0, index);
92 index = 0;
93 }
94 for (int i = 0; i < m; i++) {
95 bbuffer[index++] = selectRandom(a);
96 }
97 bbuffer[index++] = '\n';
98 n -= LINE_LENGTH;
99 }
100 if(index != 0) writer.write(bbuffer, 0, index);
101 }
102
103 static final void makeRepeatFasta(String id, String desc, String alu, int n, OutputStream writer) throws IOException
104 {

Callers 1

mainMethod · 0.95

Calls 3

selectRandomMethod · 0.95
writeMethod · 0.65
getBytesMethod · 0.45

Tested by

no test coverage detected