(String id, String desc,frequency[] a, int n, OutputStream writer)
| 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 | { |
no test coverage detected