Package java.io

Examples of java.io.FilterOutputStream


               return value;
             }
          }));
      this.out = new DataOutputStream
        (new BufferedOutputStream
         (new FilterOutputStream(socket.getOutputStream()) {
             public void write(byte[] buf, int o, int len) throws IOException {
               out.write(buf, o, len);
               if (writingCall != null) {
                 writingCall.touch();
               }
View Full Code Here


        }
        assertIsFolder(folderPath);

        final MemoryFile file = new MemoryFile();
        entries.put(filePath, file);
        return new FilterOutputStream(new ByteArrayOutputStream()) {
            public void write(byte[] bytes, int off, int len) throws IOException {
                out.write(bytes, off, len);
            }

            public void close() throws IOException {
View Full Code Here

        try {
            TransientFileFactory fileFactory = TransientFileFactory.getInstance();
            final File tmpFile = fileFactory.createTransientFile("bin", null, null);

            return new FilterOutputStream(new FileOutputStream(tmpFile)) {

                public void write(byte[] bytes, int off, int len) throws IOException {
                    out.write(bytes, off, len);
                }
View Full Code Here

            };
        }

        public OutputStream adapt(OutputStream os, ClientRequest request) {
            return new FilterOutputStream(os) {
                @Override
                public void write(byte[] b, int off, int len) throws IOException {
                    for (int i = off; i < len; i++) {
                        b[i] = toUpper(b[i]);
                    }
View Full Code Here

                     * own BufferedOutputStream.
                     */
                    OutputStream ostream;
                    if (isUsingByteArrayOutput(config)) {
                        // No need to buffer the output.
                        ostream = new FilterOutputStream(pOut){
                            public void close() throws IOException {
                                flush();
                            }
                        };
                    } else {
View Full Code Here

            }
            savWriter = logWriter;
            // DERBY-1571: If logWriter is null, stack traces are printed to
            // System.err. Set logWriter to a silent stream to suppress stack
            // traces too.
            FilterOutputStream silentStream = new FilterOutputStream(null) {
                public void write(int b) {
                }

                public void flush() {
                }
View Full Code Here

        this.encoding = encoding;

        // Intercept flush() downcalls from the writer; our caller
        // will call PGStream.flush() as needed.
        OutputStream interceptor = new FilterOutputStream(pg_output) {
                                       public void flush() throws IOException {
                                       }
                                       public void close() throws IOException {
                                           super.flush();
                                       }
View Full Code Here

     *            The cpio stream
     * @param format
     *            The format of the stream
     */
    public CpioArchiveOutputStream(final OutputStream out, final short format) {
        this.out = new FilterOutputStream(out);
        switch (format) {
        case FORMAT_NEW:
        case FORMAT_NEW_CRC:
        case FORMAT_OLD_ASCII:
        case FORMAT_OLD_BINARY:
View Full Code Here

                    throw JMSExceptionSupport.create(e);
                }
                length = 0;
                compressed = true;
                final Deflater deflater = new Deflater(Deflater.BEST_SPEED);
                os = new FilterOutputStream(new DeflaterOutputStream(os, deflater)) {
                    @Override
                    public void write(byte[] arg0) throws IOException {
                        length += arg0.length;
                        out.write(arg0);
                    }
View Full Code Here

        }
        assertIsFolder(folderPath);

        final MemoryFile file = new MemoryFile();
        entries.put(filePath, file);
        return new FilterOutputStream(new ByteArrayOutputStream()) {
            public void close() throws IOException {
                out.close();
                file.setData(((ByteArrayOutputStream) out).toByteArray());
            }
        };
View Full Code Here

TOP

Related Classes of java.io.FilterOutputStream

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.