Јава.утил.зип.ДефлатерОутпутСтреам класа у Јави

Јава.утил.зип.ДефлатерИнпутСтреам класа у Јави Ова класа имплементира филтер излазног тока за компримовање података у 'дефлате' формату компресије. Такође се користи као основа за друге типове компресијских филтера као што је ГЗИПОутпутСтреам. Конструктори и опис
    ДефлатерОутпутСтреам(ОутпутСтреам оут) : Креира нови излазни ток са подразумеваним компресором и величином бафера. ДефлатерОутпутСтреам(ОутпутСтреам оут боолеан синцФлусх) : Креира нови излазни ток са подразумеваним компресором подразумеване величине бафера и специфицираног режима испирања. ДефлатерОутпутСтреам(ОутпутСтреам оут Дефлатер деф) : Креира нови излазни ток са наведеним компресором и подразумеваном величином бафера. ДефлатерОутпутСтреам(ОутпутСтреам оут Дефлатер деф боолеан синцФлусх) : Креира нови излазни ток са наведеним режимом испирања компресора и подразумеваном величином бафера. ДефлатерОутпутСтреам(ОутпутСтреам оут Дефлатер деф инт сизе) : Креира нови излазни ток са наведеним компресором и величином бафера. ДефлатерОутпутСтреам(ОутпутСтреам оут Дефлатер деф инт сизе боолеан синцФлусх) : Креира нови излазни ток са наведеном величином бафера компресора и режимом испирања.
Методе:
    воид цлосе(): Writes remaining compressed data to the output stream and closes the underlying stream.
      Syntax :  public void close() throws IOException   Overrides:   close in class FilterOutputStream   Throws:   IOException 
    заштићени воид дефлате() : Writes next block of compressed data to the output stream.
      Syntax :  protected void deflate() throws IOException   Throws:   IOException 
    воид финисх(): Finishes writing compressed data to the output stream without closing the underlying stream.
      Syntax :  public void finish() throws IOException   Throws:   IOException 
    воид флусх() : Flushes the compressed output stream.
      Syntax :  public void flush() throws IOException   Overrides:   flush in class FilterOutputStream   Throws:   IOException 
    воид врите(бите[] б инт офф инт лен) : Writes an array of bytes to the compressed output stream.
      Syntax :  public void write(byte[] b int off int len) throws IOException   Overrides:   write in class FilterOutputStream   Parameters:   b - the data to be written off - the start offset of the data len - the length of the data   Throws:   IOException 
    воид врите(инт б): Writes a byte to the compressed output stream.
      Syntax :  public void write(int b) throws IOException   Overrides:   write in class FilterOutputStream   Parameters:   b - the byte to be written   Throws:   IOException 
Java
   //Java program to demonstrate DeflaterOutputStream   import     java.io.FileInputStream  ;   import     java.io.FileOutputStream  ;   import     java.io.IOException  ;   import     java.util.zip.DeflaterOutputStream  ;   class   DeflaterOutputStreamDemo   {      public     static     void     main  (  String  []     args  )     throws     IOException         {      FileOutputStream     fos     =     new     FileOutputStream  (  'file2.txt'  );      //Assign FileOutputStream to DeflaterOutputStream      DeflaterOutputStream     dos     =     new     DeflaterOutputStream  (  fos  );      //write it into DeflaterOutputStream      for     (  int     i     =     0  ;     i      <  10     ;     i  ++  )         {      dos  .  write  (  i  );      }          //illustrating flush() method()      dos  .  flush  ();          //illustrating finish()      //Finishes writing compressed data to the output stream      // without closing the underlying stream      dos  .  finish  ();          //fos is not closed      //writing some data on file      fos  .  write  (  'G'  );          //Writes remaining compressed data to the output stream      // closes the underlying stream.      dos  .  close  ();      }   }   
Напомена: Излаз програма неће бити видљив на онлајн ИДЕ-у јер се филе2.ткт не може прочитати овде. Креирај квиз