Java Doc for Deflater.java in  » Apache-Harmony-Java-SE » java-package » java » util » zip » 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 » Apache Harmony Java SE » java package » java.util.zip 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   java.util.zip.Deflater

Deflater
public class Deflater (Code)
The Deflater class is used to compress bytes using the DEFLATE compression algorithm. Deflation is performed by the ZLIB compression library.
See Also:   DeflaterOutputStream
See Also:   Inflater


Field Summary
final public static  intBEST_COMPRESSION
     Constant value representing the best available compression level.
final public static  intBEST_SPEED
     Constant value representing the fastest available compression level.
final public static  intDEFAULT_COMPRESSION
     Constant value representing the default compression level.
final public static  intDEFAULT_STRATEGY
     Constant value representing the default compression strategy.
final public static  intDEFLATED
     Constant value representing the deflate compression strategy.
final public static  intFILTERED
     Constant value representing the filtered compression strategy.
final public static  intHUFFMAN_ONLY
     Constant value representing the Huffman compression strategy.
final public static  intNO_COMPRESSION
     Constant value representing the no compression strategy.

Constructor Summary
public  Deflater()
     Constructs a new Deflater instance with default compression level and strategy.
public  Deflater(int level)
     Constructs a new Deflater instance with compression level level and default compression strategy.
public  Deflater(int level, boolean noHeader)
     Constructs a new Deflater instance with compression level level and default compression strategy.

Method Summary
public  intdeflate(byte[] buf)
    
public synchronized  intdeflate(byte[] buf, int off, int nbytes)
     Deflates data into the supplied buffer using the region from off to nbytes - 1.
public synchronized  voidend()
     Frees all resources held onto by this Deflater.
protected  voidfinalize()
    
public synchronized  voidfinish()
     Indicates to the Deflater that all uncompressed input has been provided to it.
public synchronized  booleanfinished()
     Returns whether or not all provided data has been successfully compressed.
public synchronized  intgetAdler()
     Returns the Adler32 checksum of uncompressed data currently read.
public synchronized  longgetBytesRead()
     Returns a long int of total number of bytes read by the Deflater.
public synchronized  longgetBytesWritten()
     Returns a long int of total number of bytes of read by the Deflater.
public synchronized  intgetTotalIn()
     Returns the total number of bytes of input consumed by the deflater.
public synchronized  intgetTotalOut()
     Returns the total number of compressed bytes output by this Deflater.
public synchronized  booleanneedsInput()
     Indicates whether or not all bytes of uncompressed input have been consumed by the Deflater.
public synchronized  voidreset()
     Resets the Deflater to accept new input without affecting any previously made settings for the compression strategy or level.
public  voidsetDictionary(byte[] buf)
     Defines a dictionary to be used for compression by the receiver.
public synchronized  voidsetDictionary(byte[] buf, int off, int nbytes)
     Sets the dictionary to be used for compression by this Deflater. setDictionary() can only be called if this Deflater supports the writing of ZLIB headers.
public  voidsetInput(byte[] buf)
     Sets the input buffer the Deflater will use to extract uncompressed bytes for later compression.
public synchronized  voidsetInput(byte[] buf, int off, int nbytes)
     Sets the input buffer the Deflater will use to extract uncompressed bytes for later compression.
public synchronized  voidsetLevel(int level)
     Sets the compression level to be used when compressing data.
public synchronized  voidsetStrategy(int strategy)
     Sets the compression strategy to be used.

Field Detail
BEST_COMPRESSION
final public static int BEST_COMPRESSION(Code)
Constant value representing the best available compression level.



BEST_SPEED
final public static int BEST_SPEED(Code)
Constant value representing the fastest available compression level.



DEFAULT_COMPRESSION
final public static int DEFAULT_COMPRESSION(Code)
Constant value representing the default compression level.



DEFAULT_STRATEGY
final public static int DEFAULT_STRATEGY(Code)
Constant value representing the default compression strategy.



DEFLATED
final public static int DEFLATED(Code)
Constant value representing the deflate compression strategy.



FILTERED
final public static int FILTERED(Code)
Constant value representing the filtered compression strategy.



HUFFMAN_ONLY
final public static int HUFFMAN_ONLY(Code)
Constant value representing the Huffman compression strategy.



NO_COMPRESSION
final public static int NO_COMPRESSION(Code)
Constant value representing the no compression strategy.




Constructor Detail
Deflater
public Deflater()(Code)
Constructs a new Deflater instance with default compression level and strategy.



Deflater
public Deflater(int level)(Code)
Constructs a new Deflater instance with compression level level and default compression strategy. THe compression level provided must be between 0 and 9.
Parameters:
  level - the compression level to use



Deflater
public Deflater(int level, boolean noHeader)(Code)
Constructs a new Deflater instance with compression level level and default compression strategy. If the noHeader parameter is specified then no ZLIB header will be written as part of the compressed output. The compression level specified must be between 0 and 9.
Parameters:
  level - the compression level to use
Parameters:
  noHeader - if true do not write the ZLIB header




Method Detail
deflate
public int deflate(byte[] buf)(Code)
Deflates data into the supplied buffer
Parameters:
  buf - buffer to store compressed data number of bytes of compressed data stored



deflate
public synchronized int deflate(byte[] buf, int off, int nbytes)(Code)
Deflates data into the supplied buffer using the region from off to nbytes - 1.
Parameters:
  buf - buffer to store compressed data
Parameters:
  off - offset inf buf to start storing data
Parameters:
  nbytes - number of bytes of compressed data to store in buf number of bytes of compressed data stored



end
public synchronized void end()(Code)
Frees all resources held onto by this Deflater. Any unused input or output is discarded. This is also called from the finalize method.
See Also:   Deflater.finalize



finalize
protected void finalize()(Code)



finish
public synchronized void finish()(Code)
Indicates to the Deflater that all uncompressed input has been provided to it.
See Also:   Deflater.finished()



finished
public synchronized boolean finished()(Code)
Returns whether or not all provided data has been successfully compressed. true if all data has been compressed, false otherwise



getAdler
public synchronized int getAdler()(Code)
Returns the Adler32 checksum of uncompressed data currently read. If a preset dictionary is used getAdler() will return the Adler32 checksum of the dictionary used. The Adler32 checksum of uncompressed data or preset dictionary ifused
See Also:   Deflater.setDictionary(byte[])
See Also:   Deflater.setDictionary(byte[],int,int)



getBytesRead
public synchronized long getBytesRead()(Code)
Returns a long int of total number of bytes read by the Deflater. This method performs the same as getTotalIn except it returns a long value instead of an integer
See Also:   Deflater.getTotalIn() bytes exactly read by deflater



getBytesWritten
public synchronized long getBytesWritten()(Code)
Returns a long int of total number of bytes of read by the Deflater. This method performs the same as getTotalOut except it returns a long value instead of an integer
See Also:   Deflater.getTotalOut() bytes exactly write by deflater



getTotalIn
public synchronized int getTotalIn()(Code)
Returns the total number of bytes of input consumed by the deflater. number of bytes of input read.



getTotalOut
public synchronized int getTotalOut()(Code)
Returns the total number of compressed bytes output by this Deflater. number of compressed bytes output.



needsInput
public synchronized boolean needsInput()(Code)
Indicates whether or not all bytes of uncompressed input have been consumed by the Deflater. If needsInput() answers true setInput() must be called before deflation can continue. If all bytes of uncompressed data have been provided to the Deflater finish() must be called to ensure the compressed data is output. True if input is required for deflation to continue, falseotherwise
See Also:   Deflater.finished()
See Also:   Deflater.setInput(byte[])
See Also:   Deflater.setInput(byte[],int,int)



reset
public synchronized void reset()(Code)
Resets the Deflater to accept new input without affecting any previously made settings for the compression strategy or level. This operation must be called after finished() returns true if the Deflater is to be reused.
See Also:   Deflater.finished()



setDictionary
public void setDictionary(byte[] buf)(Code)
Defines a dictionary to be used for compression by the receiver.
Parameters:
  buf - the entire set of bytes comprising the dictionary
See Also:   Deflater.setDictionary(byte[],int,int)



setDictionary
public synchronized void setDictionary(byte[] buf, int off, int nbytes)(Code)
Sets the dictionary to be used for compression by this Deflater. setDictionary() can only be called if this Deflater supports the writing of ZLIB headers. This is the default behaviour but can be overridden using Deflater(int, boolean).
Parameters:
  buf - the byte array containing the dictionary
Parameters:
  off - offset into the byte array
Parameters:
  nbytes - number of bytes comprising the dictionary
See Also:   Deflater.Deflater(intboolean)



setInput
public void setInput(byte[] buf)(Code)
Sets the input buffer the Deflater will use to extract uncompressed bytes for later compression.
Parameters:
  buf - the input buffer



setInput
public synchronized void setInput(byte[] buf, int off, int nbytes)(Code)
Sets the input buffer the Deflater will use to extract uncompressed bytes for later compression. Input will be taken from the buffer region starting at off and ending at nbytes - 1.
Parameters:
  buf - the input data byte array
Parameters:
  off - offset into the input bytes
Parameters:
  nbytes - number of valid bytes in the input array



setLevel
public synchronized void setLevel(int level)(Code)
Sets the compression level to be used when compressing data. The compression level must be a value between 0 and 9. This value must be set prior to calling setInput().
Parameters:
  level - compression level to use
exception:
  IllegalArgumentException - If the compression level is invalid.



setStrategy
public synchronized void setStrategy(int strategy)(Code)
Sets the compression strategy to be used. The strategy must be one of FILTERED, HUFFMAN_ONLY or DEFAULT_STRATEGY.This value must be set prior to calling setInput().
Parameters:
  strategy - compression strategy to use
exception:
  IllegalArgumentException - If the strategy specified is not one of FILTERED,HUFFMAN_ONLY or DEFAULT_STRATEGY.



Methods inherited from java.lang.Object
protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object object)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final public Class<? extends Object> getClass()(Code)(Java Doc)
public int hashCode()(Code)(Java Doc)
final public void notify()(Code)(Java Doc)
final public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final public void wait(long millis, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait(long millis) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.