Package com.esotericsoftware.kryo.serializers

Examples of com.esotericsoftware.kryo.serializers.BlowfishSerializer


/** @author Nathan Sweet <misc@n4te.com> */
public class BlowfishSerializerTest extends KryoTestCase {
  public void testZip () throws Exception {
    byte[] key = KeyGenerator.getInstance("Blowfish").generateKey().getEncoded();
    kryo.register(String.class, new BlowfishSerializer(new StringSerializer(), key));
    roundTrip(49, 49"abcdefabcdefabcdefabcdefabcdefabcdefabcdef");
  }
View Full Code Here


            LOG.debug("Blowfish serializer being constructed ...");
            if (encryption_key == null) {
                throw new RuntimeException("Blowfish encryption key not specified");
            }
            byte[] bytes =  Hex.decodeHex(encryption_key.toCharArray());
            _serializer = new BlowfishSerializer(new ListDelegateSerializer(), bytes);
        } catch (org.apache.commons.codec.DecoderException ex) {
            throw new RuntimeException("Blowfish encryption key invalid", ex);
        }
    }
View Full Code Here

      if (encryption_key == null) {
        throw new RuntimeException(
            "Blowfish encryption key not specified");
      }
      byte[] bytes = Hex.decodeHex(encryption_key.toCharArray());
      _serializer = new BlowfishSerializer(new ListDelegateSerializer(),
          bytes);
    } catch (org.apache.commons.codec.DecoderException ex) {
      throw new RuntimeException("Blowfish encryption key invalid", ex);
    }
  }
View Full Code Here

TOP

Related Classes of com.esotericsoftware.kryo.serializers.BlowfishSerializer

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.