Package java.io

Examples of java.io.FilterOutputStream


                // Get the serializer
                this.serializer = (Serializer) this.selector.select(serializerType);

                // Direct its output to the zip file, filtering calls to close()
                // (we don't want the archive to be closed by the serializer)
                this.serializer.setOutputStream(new FilterOutputStream(this.zipOutput) {
                    public void close() { /*nothing*/
                    }
                });

                // Set it as the current XMLConsumer
View Full Code Here


    }

    public HierarchicalStreamWriter createWriter(final OutputStream out) {
        try {
            final HierarchicalStreamWriter[] writer = new HierarchicalStreamWriter[1];
            final FilterOutputStream filter = new FilterOutputStream(out){
                public void close() {
                    writer[0].close();
                }
            };
            writer[0] = new Dom4JWriter(new XMLWriter(filter,  outputFormat), xmlFriendlyReplacer());
View Full Code Here

               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

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

            return new FilterOutputStream(new FileOutputStream(tmpFile)) {

                public void close() throws IOException {
                    super.close();

                    PreparedStatement stmt = null;
View Full Code Here

        // Write jbi.xml
        jos.putNextEntry(new ZipEntry("META-INF/jbi.xml"));
        XMLOutputFactory xof = XMLOutputFactory.newInstance();
        // xof.setProperty(XMLOutputFactory.IS_REPAIRING_NAMESPACES,
        // Boolean.TRUE);
        XMLStreamWriter xsw = xof.createXMLStreamWriter(new FilterOutputStream(jos) {
            public void close() {
            }
        });
        xsw.writeStartDocument();
        xsw.writeStartElement("jbi");
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

               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

    static final int CHUNK_SIZE = 8192;
   
    private final String name;

    public FSIndexOutput(String name) throws IOException {
      super(new FilterOutputStream(new FileOutputStream(new File(directory, name))) {
        // This implementation ensures, that we never write more than CHUNK_SIZE bytes:
        @Override
        public void write(byte[] b, int offset, int length) throws IOException {
          while (length > 0) {
            final int chunk = Math.min(length, CHUNK_SIZE);
View Full Code Here

    ByteArrayOutputStream byteStream = new ByteArrayOutputStream(bufSize);
    final BytesRef bytesRef = new BytesRef();//receiver of byteStream's bytes
    try {
      ctx.getBinaryCodec().writeShape(new DataOutputStream(byteStream), shape);
      //this is a hack to avoid redundant byte array copying by byteStream.toByteArray()
      byteStream.writeTo(new FilterOutputStream(null/*not used*/) {
        @Override
        public void write(byte[] b, int off, int len) throws IOException {
          bytesRef.bytes = b;
          bytesRef.offset = off;
          bytesRef.length = len;
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.