public ZipUTF8Writer build ( final OutputStream out ) { final OutputStream bufferedOut ; switch ( this . zipBufferSize ) { case NO_BUFFER : bufferedOut = out ; break ; case DEFAULT_BUFFER : bufferedOut = new BufferedOutputStream ( out ) ; break ; default : bufferedOut = new BufferedOutputStream ( out , this . zipBufferSize ) ; break ; } final ZipOutputStream zipOut = new ZipOutputStream ( bufferedOut ) ; zipOut . setMethod ( ZipOutputStream . DEFLATED ) ; zipOut . setLevel ( this . level ) ; final Writer writer = new OutputStreamWriter ( zipOut , ZipUTF8Writer . UTF_8 ) ; final Writer bufferedWriter ; switch ( this . writerBufferSize ) { case NO_BUFFER : bufferedWriter = writer ; break ; case DEFAULT_BUFFER : bufferedWriter = new BufferedWriter ( writer ) ; break ; default : bufferedWriter = new BufferedWriter ( writer , this . writerBufferSize ) ; break ; } return new ZipUTF8WriterImpl ( zipOut , bufferedWriter ) ; }
Build the new writer with a given output stream