Package com.sun.faces.io

Examples of com.sun.faces.io.Base64OutputStreamWriter


        if (stateManager.isSavingStateInClient(context)) {
            ObjectOutputStream oos = null;
            try {

                Base64OutputStreamWriter bos =
                      new Base64OutputStreamWriter(csBuffSize,
                                                   writer);
                OutputStream base;
                if (compressState) {
                    base = new GZIPOutputStream(bos, 1024);
                } else {
                    base = bos;
                }
                if (guard != null) {
                    oos = serialProvider.createObjectOutputStream(
                          new BufferedOutputStream(
                                new CipherOutputStream(base, guard.getEncryptionCipher())));
                } else {
                    oos = serialProvider
                          .createObjectOutputStream(new BufferedOutputStream(
                                base,
                                1024));
                }

                if (webConfig.isSet(WebContextInitParameter.ClientStateTimeout)) {
                    oos.writeLong(System.currentTimeMillis());
                }
                //noinspection NonSerializableObjectPassedToObjectStream
                oos.writeObject(view.getStructure());
                //noinspection NonSerializableObjectPassedToObjectStream
                oos.writeObject(view.getState());
                oos.flush();
                oos.close();

                // flush everything to the underlying writer
                bos.finish();

                if (LOGGER.isLoggable(Level.FINE)) {
                    LOGGER.fine("Client State: total number of characters"
                                + " written: " + bos.getTotalCharsWritten());
                }
            } finally {
                if (oos != null) {
                    try {
                        oos.close();
View Full Code Here


                // this will MAC
                bytes = guard.encrypt(bytes);
            }

            // Base 64 encode
            Base64OutputStreamWriter bos =
                new Base64OutputStreamWriter(bytes.length, writer);
            bos.write(bytes, 0, bytes.length);
            bos.finish();
           
            if (LOGGER.isLoggable(Level.FINE)) {
                LOGGER.log(Level.FINE,
                           "Client State: total number of characters written: {0}",
                           bos.getTotalCharsWritten());
            }
        } finally {
            if (oos != null) {
                try {
                    oos.close();
View Full Code Here

        if (stateManager.isSavingStateInClient(context)) {
            ObjectOutputStream oos = null;
            try {

                Base64OutputStreamWriter bos =
                      new Base64OutputStreamWriter(csBuffSize,
                                                   writer);
                OutputStream base;
                if (guard != null) {
                    base = new CipherOutputStream(bos,
                                                  guard.getEncryptionCipher());
                } else {
                    base = bos;
                }
                if (compressState) {
                    oos = serialProvider.createObjectOutputStream(
                          new BufferedOutputStream(new GZIPOutputStream(base),
                                                   1024));
                } else {
                    oos = serialProvider
                          .createObjectOutputStream(new BufferedOutputStream(
                                base,
                                1024));
                }

                //noinspection NonSerializableObjectPassedToObjectStream
                oos.writeObject(view.getStructure());
                //noinspection NonSerializableObjectPassedToObjectStream
                oos.writeObject(view.getState());
                oos.flush();
                oos.close();

                // flush everything to the underlying writer
                bos.finish();
               
                if (LOGGER.isLoggable(Level.FINE)) {
                    LOGGER.fine("Client State: total number of characters"
                                + " written: " + bos.getTotalCharsWritten());
                }
            } finally {
                if (oos != null) {
                    try {
                        oos.close();
View Full Code Here

        Object[] stateToWrite = (Object[]) state;
        ObjectOutputStream oos = null;
        try {

            Base64OutputStreamWriter bos =
                  new Base64OutputStreamWriter(csBuffSize,
                                               writer);
            oos = initOutputStream(bos);

            if (stateTimeoutEnabled) {
                oos.writeLong(System.currentTimeMillis());
            }
            //noinspection NonSerializableObjectPassedToObjectStream
            oos.writeObject(stateToWrite[0]);
            //noinspection NonSerializableObjectPassedToObjectStream
            oos.writeObject(stateToWrite[1]);
            oos.flush();
            oos.close();

            // flush everything to the underlying writer
            bos.finish();

            if (LOGGER.isLoggable(Level.FINE)) {
                LOGGER.log(Level.FINE,
                           "Client State: total number of characters written: {0}",
                           bos.getTotalCharsWritten());
            }
        } finally {
            if (oos != null) {
                try {
                    oos.close();
View Full Code Here

                // this will MAC
                bytes = guard.encrypt(bytes);
            }

            // Base 64 encode
            Base64OutputStreamWriter bos =
                new Base64OutputStreamWriter(bytes.length, writer);
            bos.write(bytes, 0, bytes.length);
            bos.finish();
           
            if (LOGGER.isLoggable(Level.FINE)) {
                LOGGER.log(Level.FINE,
                           "Client State: total number of characters written: {0}",
                           bos.getTotalCharsWritten());
            }
        } finally {
            if (oos != null) {
                try {
                    oos.close();
View Full Code Here

                // this will MAC
                bytes = guard.encrypt(bytes);
            }

            // Base 64 encode
            Base64OutputStreamWriter bos =
                new Base64OutputStreamWriter(bytes.length, writer);
            bos.write(bytes, 0, bytes.length);
            bos.finish();
           
            if (LOGGER.isLoggable(Level.FINE)) {
                LOGGER.log(Level.FINE,
                           "Client State: total number of characters written: {0}",
                           bos.getTotalCharsWritten());
            }
        } finally {
            if (oos != null) {
                try {
                    oos.close();
View Full Code Here

        Object[] stateToWrite = (Object[]) state;
        ObjectOutputStream oos = null;
        try {

            Base64OutputStreamWriter bos =
                  new Base64OutputStreamWriter(csBuffSize,
                                               writer);
            oos = initOutputStream(bos);

            if (stateTimeoutEnabled) {
                oos.writeLong(System.currentTimeMillis());
            }
            //noinspection NonSerializableObjectPassedToObjectStream
            oos.writeObject(stateToWrite[0]);
            //noinspection NonSerializableObjectPassedToObjectStream
            oos.writeObject(stateToWrite[1]);
            oos.flush();
            oos.close();

            // flush everything to the underlying writer
            bos.finish();

            if (LOGGER.isLoggable(Level.FINE)) {
                LOGGER.log(Level.FINE,
                           "Client State: total number of characters written: {0}",
                           bos.getTotalCharsWritten());
            }
        } finally {
            if (oos != null) {
                try {
                    oos.close();
View Full Code Here

        if (stateManager.isSavingStateInClient(context)) {
            ObjectOutputStream oos = null;
            try {

                Base64OutputStreamWriter bos =
                      new Base64OutputStreamWriter(csBuffSize,
                                                   writer);
                OutputStream base;
                if (compressState) {
                    base = new GZIPOutputStream(bos, 1024);
                } else {
                    base = bos;
                }
                if (guard != null) {
                    oos = serialProvider.createObjectOutputStream(
                          new BufferedOutputStream(
                                new CipherOutputStream(base, guard.getEncryptionCipher())));
                } else {
                    oos = serialProvider
                          .createObjectOutputStream(new BufferedOutputStream(
                                base,
                                1024));
                }

                if (webConfig.isSet(WebContextInitParameter.ClientStateTimeout)) {
                    oos.writeLong(System.currentTimeMillis());
                }
                //noinspection NonSerializableObjectPassedToObjectStream
                oos.writeObject(view.getStructure());
                //noinspection NonSerializableObjectPassedToObjectStream
                oos.writeObject(view.getState());
                oos.flush();
                oos.close();

                // flush everything to the underlying writer
                bos.finish();

                if (LOGGER.isLoggable(Level.FINE)) {
                    LOGGER.fine("Client State: total number of characters"
                                + " written: " + bos.getTotalCharsWritten());
                }
            } finally {
                if (oos != null) {
                    try {
                        oos.close();
View Full Code Here

                // this will MAC
                bytes = guard.encrypt(bytes);
            }

            // Base 64 encode
            Base64OutputStreamWriter bos =
                new Base64OutputStreamWriter(bytes.length, writer);
            bos.write(bytes, 0, bytes.length);
            bos.finish();

            if (LOGGER.isLoggable(Level.FINE)) {
                LOGGER.log(Level.FINE,
                           "Client State: total number of characters written: {0}",
                           bos.getTotalCharsWritten());
            }
        } finally {
            if (oos != null) {
                try {
                    oos.close();
View Full Code Here

                // this will MAC
                bytes = guard.encrypt(bytes);
            }

            // Base 64 encode
            Base64OutputStreamWriter bos =
                new Base64OutputStreamWriter(bytes.length, writer);
            bos.write(bytes, 0, bytes.length);
            bos.finish();
           
            if (LOGGER.isLoggable(Level.FINE)) {
                LOGGER.log(Level.FINE,
                           "Client State: total number of characters written: {0}",
                           bos.getTotalCharsWritten());
            }
        } finally {
            if (oos != null) {
                try {
                    oos.close();
View Full Code Here

TOP

Related Classes of com.sun.faces.io.Base64OutputStreamWriter

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.