File: BlowfishSerializerTest.java

package info (click to toggle)
libkryo-java 2.20-8
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 580 kB
  • sloc: java: 8,712; xml: 172; makefile: 4
file content (16 lines) | stat: -rw-r--r-- 614 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16

package com.esotericsoftware.kryo;

import javax.crypto.KeyGenerator;

import com.esotericsoftware.kryo.serializers.BlowfishSerializer;
import com.esotericsoftware.kryo.serializers.DefaultSerializers.StringSerializer;

/** @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, "abcdefabcdefabcdefabcdefabcdefabcdefabcdef");
	}
}