You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

ImageReader.java 1.9KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. /*
  2. * Licensed to the Apache Software Foundation (ASF) under one or more
  3. * contributor license agreements. See the NOTICE file distributed with
  4. * this work for additional information regarding copyright ownership.
  5. * The ASF licenses this file to You under the Apache License, Version 2.0
  6. * (the "License"); you may not use this file except in compliance with
  7. * the License. You may obtain a copy of the License at
  8. *
  9. * http://www.apache.org/licenses/LICENSE-2.0
  10. *
  11. * Unless required by applicable law or agreed to in writing, software
  12. * distributed under the License is distributed on an "AS IS" BASIS,
  13. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  14. * See the License for the specific language governing permissions and
  15. * limitations under the License.
  16. */
  17. /* $Id$ */
  18. package org.apache.fop.image.analyser;
  19. // Java
  20. import java.io.InputStream;
  21. import java.io.IOException;
  22. // FOP
  23. import org.apache.fop.image.FopImage;
  24. import org.apache.fop.apps.FOUserAgent;
  25. /**
  26. * ImageReader objects read image headers to determine the image size.
  27. *
  28. * @author Pankaj Narula
  29. * @version $Id$
  30. */
  31. public interface ImageReader {
  32. /**
  33. * Verify image type. If the stream does not contain image data expected by
  34. * the reader it must reset the stream to the start. This is so that the
  35. * next reader can start reading from the start. The reader must not close
  36. * the stream unless it can handle the image and it has read the
  37. * information.
  38. *
  39. * @param bis Image buffered input stream
  40. * @param uri URI to the image
  41. * @param ua The user agent
  42. * @return <code>true</code> if image type is the handled one
  43. * @exception IOException if an I/O error occurs
  44. */
  45. FopImage.ImageInfo verifySignature(String uri, InputStream bis,
  46. FOUserAgent ua)
  47. throws IOException;
  48. }