1 18 package org.apache.batik.transcoder.image; 19 20 import java.io.IOException ; 21 import java.io.InputStreamReader ; 22 import java.io.Reader ; 23 import java.net.URL ; 24 25 import org.apache.batik.transcoder.TranscoderInput; 26 27 33 public class ReaderTest extends AbstractImageTranscoderTest { 34 35 36 protected String inputURI; 37 38 39 protected String refImageURI; 40 41 47 public ReaderTest(String inputURI, String refImageURI) { 48 this.inputURI = inputURI; 49 this.refImageURI = refImageURI; 50 } 51 52 55 protected TranscoderInput createTranscoderInput() { 56 try { 57 URL url = resolveURL(inputURI); 58 Reader reader = new InputStreamReader (url.openStream()); 59 TranscoderInput input = new TranscoderInput(reader); 60 input.setURI(url.toString()); return input; 62 } catch (IOException ex) { 63 throw new IllegalArgumentException (inputURI); 64 } 65 } 66 67 70 protected byte [] getReferenceImageData() { 71 return createBufferedImageData(resolveURL(refImageURI)); 72 } 73 } 74 | Popular Tags |