Source Code Cross Referenced for GZIPTileDecoderFactory.java in  » 6.0-JDK-Modules » Java-Advanced-Imaging » com » sun » media » jai » tilecodec » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » 6.0 JDK Modules » Java Advanced Imaging » com.sun.media.jai.tilecodec 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


01:        /*
02:         * $RCSfile: GZIPTileDecoderFactory.java,v $
03:         *
04:         * Copyright (c) 2005 Sun Microsystems, Inc. All rights reserved.
05:         *
06:         * Use is subject to license terms.
07:         *
08:         * $Revision: 1.1 $
09:         * $Date: 2005/02/11 04:56:57 $
10:         * $State: Exp $
11:         */package com.sun.media.jai.tilecodec;
12:
13:        import java.io.InputStream;
14:        import java.util.Vector;
15:        import java.util.zip.GZIPInputStream;
16:        import javax.media.jai.ParameterListDescriptorImpl;
17:        import javax.media.jai.remote.NegotiableCapability;
18:        import javax.media.jai.tilecodec.TileDecoder;
19:        import javax.media.jai.tilecodec.TileDecoderFactory;
20:        import javax.media.jai.tilecodec.TileCodecParameterList;
21:
22:        /**
23:         * A factory for creating <code>GZIPTileDecoder</code>s.
24:         *
25:         * <p> This class stipulates that the capabilities of the 
26:         * <code>TileDecoder</code> be specified by implementing the
27:         * <code>getDecodingCapability()</code> method. 
28:         *
29:         * @see javax.media.jai.remote.NegotiableCapability
30:         */
31:        public class GZIPTileDecoderFactory implements  TileDecoderFactory {
32:
33:            /** 
34:             * Creates a <code>GZIPTileDecoder</code> capable of decoding the encoded 
35:             * data from the given <code>InputStream</code> using the specified
36:             * <code>TileCodecParameterList</code> containing the decoding
37:             * parameters to be used.
38:             *
39:             * <p> This method can return null if the <code>TileDecoder</code> is not
40:             * capable of producing output for the given set of parameters.  
41:             * For example, if a <code>TileDecoder</code> is only capable of dealing
42:             * with a jpeg quality factor of 0.5, and the associated
43:             * <code>TileCodecParameterList</code> specifies a quality factor of 0.75,
44:             * null should be returned.
45:             *
46:             * <p>It is recommended that the data in the supplied 
47:             * <code>InputStream</code> not be used as a factor in determining
48:             * whether this <code>InputStream</code> can be successfully decoded,
49:             * unless the supplied <code>InputStream</code> is known to be rewindable
50:             * (i.e. its <code>markSupported()</code> method returns true or it has
51:             * additional functionality that allows backward seeking). It is required
52:             * that <code>the</code> InputStream contain the same data on 
53:             * returning from this method as before this method was called.
54:             * In other words, the <code>InputStream</code> should only be used as a
55:             * discriminator if it can be rewound to its starting position
56:             * before returning from this method. Note that wrapping the
57:             * incoming <code>InputStream</code> in a <code>PushbackInputStream</code>
58:             * and then rewinding the <code>PushbackInputStream</code> before returning
59:             * does not rewind the wrapped <code>InputStream</code>.
60:             *
61:             * <p> If the supplied <code>TileCodecParameterList</code> is null,
62:             * a default <code>TileCodecParameterList</code> from the
63:             * <code>TileCodecDescriptor</code> will be used to create the decoder.
64:             *
65:             * <p> Exceptions thrown by the <code>TileDecoder</code> will be
66:             * caught by this method and will not be propagated.
67:             *
68:             * @param input The <code>InputStream</code> containing the encoded data
69:             *              to decode.
70:             * @param param The parameters to be be used in the decoding process.
71:             * @throws IllegalArgumentException if input is null.
72:             */
73:            public TileDecoder createDecoder(InputStream input,
74:                    TileCodecParameterList param) {
75:
76:                if (input == null)
77:                    throw new IllegalArgumentException(JaiI18N
78:                            .getString("TileDecoder0"));
79:
80:                return new GZIPTileDecoder(input, param);
81:            }
82:
83:            /** 
84:             * Returns the capabilities of this <code>TileDecoder</code> as a
85:             * <code>NegotiableCapability</code>.
86:             */
87:            public NegotiableCapability getDecodeCapability() {
88:
89:                Vector generators = new Vector();
90:                generators.add(GZIPTileDecoderFactory.class);
91:
92:                return new NegotiableCapability("tileCodec", "gzip",
93:                        generators, new ParameterListDescriptorImpl(null, null,
94:                                null, null, null), false);
95:            }
96:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.