Package java.io

Examples of java.io.FilterOutputStream


        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


        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

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

            return new FilterOutputStream(new FileOutputStream(tmpFile)) {
                File f = tmpFile;

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

     * @throws IOException
     */
    final PrintStream createIsolatedOut() throws IOException {
        final OutputStream stream;
        if (outStream != null) {
            stream = new FilterOutputStream(outStream);
        } else if (outSocket != null) {
            stream = new FilterOutputStream(outSocket.getOutputStream());
        } else {
            IOContext ioContext = VmIsolate.getRoot().getIOContext();
            stream = new FilterOutputStream(ioContext.getRealSystemOut());
        }
        return new PrintStream(stream);
    }
View Full Code Here

     * @throws IOException
     */
    final PrintStream createIsolatedErr() throws IOException {
        final OutputStream stream;
        if (errStream != null) {
            stream = new FilterOutputStream(errStream);
        } else if (errSocket != null) {
            stream = new FilterOutputStream(errSocket.getOutputStream());
        } else {
            IOContext ioContext = VmIsolate.getRoot().getIOContext();
            stream = new FilterOutputStream(ioContext.getRealSystemErr());
        }
        return new PrintStream(stream);
    }
View Full Code Here

    }
  }
  public void test (TestHarness harness)
  {
  ByteArrayOutputStream baos = new ByteArrayOutputStream();
  FilterOutputStream fos = new FilterOutputStream(baos);;
  byte[] ba = {(byte)'B', (byte)'C', (byte)'D'};
  try {
    String tststr = "ABCD";
    fos.write('A');
    harness.check(true, "write(int)");
    fos.write(ba);
    harness.check(true, "write(buf)");
    fos.write(ba,0,3);
    harness.check(true, "write(buf,off,len)");
    byte[] finalba = baos.toByteArray();
    String finalstr2 = new String(finalba);
    harness.check(finalstr2.equals("ABCDBCD"), "wrote all characters okay");
    baos.flush();
View Full Code Here

            }

            this.currentPath = pkgName + fileName;
            this.currentBaos = new ByteArrayOutputStream();

            return new FilterOutputStream( this.currentBaos ) {
                public void close() {
                    // don't let this stream close
                }
            };
        }
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)) {
                    public void write(byte[] arg0) throws IOException {
                        length += arg0.length;
                        out.write(arg0);
                    }
View Full Code Here

                // 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

                    throw JMSExceptionSupport.create(e);
                }
                length=0;
                compressed = true;
                Deflater deflater = new Deflater(Deflater.BEST_SPEED);
                os = new FilterOutputStream(new DeflaterOutputStream(os,deflater)) {
                    public void write(byte[] arg0) throws IOException {
                        length+=arg0.length;
                        out.write(arg0);
                    }
                    public void write(byte[] arg0, int arg1, int arg2) throws IOException {
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.