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