Examples of Base64InputStream


Examples of com.ibm.commons.util.io.base64.Base64InputStream

        }
       
        try {
            byte[] base64 = cyphertext.getBytes("ASCII"); //$NON-NLS-1$
            ByteArrayInputStream bin = new ByteArrayInputStream(base64);
            Base64InputStream base64in = new Base64InputStream(bin);
            ByteArrayOutputStream buffer = new ByteArrayOutputStream();
            byte[] barr = new byte[cyphertext.length()];
            while(true) {
                int r = base64in.read(barr);
                if(r<=0) break;
                buffer.write(barr, 0, r);
            }
            byte[] encrypted = buffer.toByteArray();
            byte[] plaintext = decrypt(key, encrypted);
View Full Code Here

Examples of com.sun.faces.io.Base64InputStream

            ObjectInputStream ois = null;

            try {
                InputStream bis;
                if (compressState) {
                    bis = new GZIPInputStream(new Base64InputStream(viewString));
                } else {
                    bis = new Base64InputStream(viewString);
                }
                if (guard != null) {
                    ois = serialProvider.createObjectInputStream(new CipherInputStream(bis, guard.getDecryptionCipher()));
                } else {
                    ois = serialProvider.createObjectInputStream(bis);
View Full Code Here

Examples of com.sun.faces.io.Base64InputStream

        if ("stateless".equals(stateString)) {
            return null;
        }
       
        ObjectInputStream ois = null;
        InputStream bis = new Base64InputStream(stateString);
        try {
            if (guard != null) {
                byte[] bytes = stateString.getBytes();
                int numRead = bis.read(bytes, 0, bytes.length);
                byte[] decodedBytes = new byte[numRead];
                bis.reset();
                bis.read(decodedBytes, 0, decodedBytes.length);

                bytes = guard.decrypt(decodedBytes);
                if (bytes == null) return null;
                bis = new ByteArrayInputStream(bytes);
            }
View Full Code Here

Examples of com.sun.faces.io.Base64InputStream

            try {                          
                InputStream bis;
                if (guard != null) {
                    bis = new CipherInputStream(
                          new Base64InputStream(viewString),
                          guard.getDecryptionCipher());                   
                } else {
                    bis = new Base64InputStream(viewString);
                }
                   
                if (compressState) {                                       
                    ois = serialProvider.createObjectInputStream(
                          new GZIPInputStream(bis));
View Full Code Here

Examples of com.sun.faces.io.Base64InputStream

    private ObjectInputStream initInputStream(String stateString)
    throws IOException {

        InputStream bis;
        if (compressViewState) {
            bis = new GZIPInputStream(new Base64InputStream(stateString));
        } else {
            bis = new Base64InputStream(stateString);
        }

        ObjectInputStream ois;
        if (guard != null) {
            ois = serialProvider
View Full Code Here

Examples of com.sun.faces.io.Base64InputStream

     * @param stateString the Base64 encoded view state
     * @return the view state reconstructed from <code>stateString</code>
     */
    protected Object doGetState(String stateString) {
        ObjectInputStream ois = null;
        InputStream bis = new Base64InputStream(stateString);
        try {
            if (guard != null) {
                byte[] bytes = stateString.getBytes();
                int numRead = bis.read(bytes, 0, bytes.length);
                byte[] decodedBytes = new byte[numRead];
                bis.reset();
                bis.read(decodedBytes, 0, decodedBytes.length);

                bytes = guard.decrypt(decodedBytes);
                if (bytes == null) return null;
                bis = new ByteArrayInputStream(bytes);
            }
View Full Code Here

Examples of org.apache.commons.codec.binary.Base64InputStream

            Configuration conf,
            String encoded) throws IOException, ClassNotFoundException {
        assert conf != null;
        assert encoded != null;
        ByteArrayInputStream source = new ByteArrayInputStream(encoded.getBytes(ASCII));
        DataInputStream input = new DataInputStream(new GZIPInputStream(new Base64InputStream(source)));
        long version = WritableUtils.readVLong(input);
        if (version != SERIAL_VERSION) {
            throw new IOException(MessageFormat.format(
                    "Invalid StageInput version: framework={0}, saw={1}",
                    SERIAL_VERSION,
View Full Code Here

Examples of org.apache.commons.codec.binary.Base64InputStream

            return Collections.emptyList();
        }
        VariableTable table = getVariableTable(context);
        try {
            ByteArrayInputStream source = new ByteArrayInputStream(encoded.getBytes(ASCII));
            DataInputStream input = new DataInputStream(new GZIPInputStream(new Base64InputStream(source)));
            long version = WritableUtils.readVLong(input);
            if (version != SERIAL_VERSION) {
                throw new IOException(MessageFormat.format(
                        "Invalid StageOutput version: framework={0}, saw={1}",
                        SERIAL_VERSION,
View Full Code Here

Examples of org.apache.commons.codec.binary.Base64InputStream

                byte []dataBytes=new byte[dataBytesBufferSize];
                try{
                    InputStream inputStream;
                    {
                        BufferedInputStream bis = new BufferedInputStream(fis);
                        inputStream = header.isBase64() ? new Base64InputStream(bis): bis;
                    }
                    try{
                        long nSkip;
                        long toSkip=header.getHeaderSize();
                        while((nSkip=fis.skip(toSkip))!=toSkip){
View Full Code Here

Examples of org.apache.commons.codec.binary.Base64InputStream

        //InputStream inputStream;
        try{
            int firstByte=inputStream.read();
            boolean base64;
            if(firstByte==BASE64_ENCODING){
                in64=new Base64InputStream(inputStream);//base64 decode
                inputStream=in64;
                base64=true;
            }else if(firstByte==BINARY_ENCODING){
                //inputStream=in;
                base64=false;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.