|
|||||||||||||||||||
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 | |||||||||||||||
InputStreamCharStream.java | - | 0% | 0% | 0% |
|
1 |
package org.codehaus.groovy.syntax.lexer;
|
|
2 |
|
|
3 |
import java.io.InputStream;
|
|
4 |
import java.io.IOException;
|
|
5 |
import org.codehaus.groovy.syntax.ReadException;
|
|
6 |
|
|
7 |
public class InputStreamCharStream |
|
8 |
extends AbstractCharStream
|
|
9 |
{ |
|
10 |
private InputStream in;
|
|
11 |
|
|
12 | 0 |
public InputStreamCharStream(InputStream in)
|
13 |
{ |
|
14 | 0 |
this.in = in;
|
15 |
} |
|
16 |
|
|
17 | 0 |
public InputStreamCharStream(InputStream in,
|
18 |
String description) |
|
19 |
{ |
|
20 | 0 |
super( description );
|
21 | 0 |
this.in = in;
|
22 |
} |
|
23 |
|
|
24 | 0 |
public InputStream getInputStream()
|
25 |
{ |
|
26 | 0 |
return in;
|
27 |
} |
|
28 |
|
|
29 | 0 |
public char consume() |
30 |
throws ReadException
|
|
31 |
{ |
|
32 | 0 |
try
|
33 |
{ |
|
34 | 0 |
return (char) getInputStream().read(); |
35 |
} |
|
36 |
catch( IOException e )
|
|
37 |
{ |
|
38 | 0 |
throw new ReadException( e ); |
39 |
} |
|
40 |
} |
|
41 |
|
|
42 | 0 |
public void close() |
43 |
throws ReadException
|
|
44 |
{ |
|
45 | 0 |
try
|
46 |
{ |
|
47 | 0 |
getInputStream().close(); |
48 |
} |
|
49 |
catch( IOException e )
|
|
50 |
{ |
|
51 | 0 |
throw new ReadException( e ); |
52 |
} |
|
53 |
} |
|
54 |
} |
|
55 |
|
|