1 46 47 package org.codehaus.groovy.control.io; 48 49 import java.io.IOException ; 50 import java.io.InputStream ; 51 import java.io.InputStreamReader ; 52 import java.io.Reader ; 53 54 import org.codehaus.groovy.control.CompilerConfiguration; 55 56 57 64 65 public class InputStreamReaderSource extends AbstractReaderSource 66 { 67 68 71 private InputStream stream; 73 74 77 78 public InputStreamReaderSource( InputStream stream, CompilerConfiguration configuration ) 79 { 80 super( configuration ); 81 this.stream = stream; 82 } 83 84 85 86 89 90 public Reader getReader() throws IOException 91 { 92 if( stream != null ) 93 { 94 Reader reader = new InputStreamReader ( stream, configuration.getSourceEncoding() ); 95 stream = null; 96 97 return reader; 98 } 99 100 return null; 101 } 102 103 104 105 109 110 public boolean canReopenSource() 111 { 112 return false; 113 } 114 115 116 117 118 119 } 120 | Popular Tags |