Clover coverage report - brownies library - 1.0-beta-1 Coverage timestamp: 月 8 16 2004 17:14:42 GMT+09:00 FRAMES NO FRAMES |
file stats: | LOC: | 45 |  | Methods: | 2
| NCLOC: | 25 |  | Classes: | 1
30 day Evaluation Version distributed via the Maven Jar Repository. Clover is not free. You have 30 days to evaluate it. Please visit http://www.thecortex.net/clover to obtain a licensed version of Clover
Source file | Conditionals | Statements | Methods | TOTAL
StringLoader.java | 0% | 0% | 0% | 0% |

1 |  |
     /*
2 |  |
      * Joey and its relative products are published under the terms
3 |  |
      * of the Apache Software License.
4 |  |
      */
5 |  |
     /*
6 |  |
      * Created on 2003/12/18
7 |  |
      */
8 |  |
     package org.asyrinx.brownie.core.io.sf;
9 |  |
10 |  |
     import java.io.BufferedReader;
11 |  |
     import java.io.IOException;
12 |  |
     import java.io.InputStreamReader;
13 |  |
14 |  |
     /**
15 |  |
      * @author akima
16 |  |
      */
17 |  |
     public class StringLoader {
18 |  |
19 |  |
         /**
20 |  |
          *
21 |  |
          */
22 | 0 |
         public StringLoader(StreamFactory factory) {
23 | 0 |
             super();
24 | 0 |
             this.factory = factory;
25 |  |
         }
26 |  |
27 |  |
         private final StreamFactory factory;
28 |  |
29 | 0 |
         public String load(Object key) throws IOException {
30 | 0 |
             BufferedReader reader = new BufferedReader(new InputStreamReader(
31 |  |
                     factory.newInput(key)));
32 | 0 |
             try {
33 | 0 |
                 StringBuffer result = new StringBuffer();
34 | 0 |
                 int c = reader.read();
35 | 0 |
                 while (c > 0) {
36 | 0 |
                     result.append((char) c);
37 | 0 |
                     c = reader.read();
38 |  |
                 }
39 | 0 |
                 return result.toString();
40 |  |
             } finally {
41 | 0 |
                 reader.close();
42 |  |
             }
43 |  |
         }
44 |  |
45 |  |
     }