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.

DCTFilter.java 1.0KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. /*
  2. * $Id$
  3. * Copyright (C) 2001 The Apache Software Foundation. All rights reserved.
  4. * For details on use and redistribution please refer to the
  5. * LICENSE file included with these sources.
  6. */
  7. package org.apache.fop.pdf;
  8. import org.apache.fop.util.StreamUtilities;
  9. import java.io.IOException;
  10. import java.io.InputStream;
  11. import java.io.OutputStream;
  12. /**
  13. * DCT Filter class. Right now it is just used as a dummy filter flag so
  14. * we can write JPG images to the PDF. The encode method just returns the
  15. * data passed to it. In the future an actual JPEG compression should be
  16. * added to the encode method so other images can be compressed.
  17. *
  18. * @author Eric Dalquist
  19. */
  20. public class DCTFilter extends PDFFilter {
  21. public String getName() {
  22. return "/DCTDecode";
  23. }
  24. public String getDecodeParms() {
  25. return null;
  26. }
  27. public void encode(InputStream in, OutputStream out, int length) throws IOException {
  28. StreamUtilities.streamCopy(in, out, length);
  29. out.close();
  30. }
  31. }