本文整理汇总了Java中org.openyu.commons.lang.EncodingHelper.encodeBase64方法的典型用法代码示例。如果您正苦于以下问题:Java EncodingHelper.encodeBase64方法的具体用法?Java EncodingHelper.encodeBase64怎么用?Java EncodingHelper.encodeBase64使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.openyu.commons.lang.EncodingHelper
的用法示例。
在下文中一共展示了EncodingHelper.encodeBase64方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: deflaterBase64
import org.openyu.commons.lang.EncodingHelper; //导入方法依赖的package包/类
@Test
@BenchmarkOptions(benchmarkRounds = 3, warmupRounds = 2, concurrency = 1)
// round: 0.38
public void deflaterBase64() throws Exception {
// 789
String value = "Catalog||Games, movies & music||Music||Childrens,Catalog||Games, movies & music||Music||Jazz music,Catalog||Games, movies & music||Music||Blues music,Catalog||Games, movies & music||Video||Television: series,Catalog||Games, movies & music||Music||Folk music,Catalog||Games, movies & music||Video||Miscellaneous,Catalog||Games, movies & music||Music||Popular music,Catalog||Games, movies & music||Music||New age music,Catalog||Games, movies & music||Music||Original cast recordings,Catalog||Games, movies & music||Video||Westerns,Catalog||Games, movies & music||Video||Horror,Catalog||Games, movies & music||Music||Music video: latin,Catalog||Games, movies & music||Music||Classical music,Catalog||Games, movies & music||Music||World music,Catalog||Games, movies & music||Music||Electronica";
byte[] encode = EncodingHelper.encodeBase64(value);// 1052
//
byte[] result = null;
int count = 10000;
for (int i = 0; i < count; i++) {
result = CompressHelperWithoutPool.deflater(encode);
}
System.out.println("length: " + result.length);// 336
assertEquals(336, result.length);
}
示例2: inflaterBase64
import org.openyu.commons.lang.EncodingHelper; //导入方法依赖的package包/类
@Test
@BenchmarkOptions(benchmarkRounds = 3, warmupRounds = 2, concurrency = 1)
// round: 0.13
public void inflaterBase64() throws Exception {
// 789
String value = "Catalog||Games, movies & music||Music||Childrens,Catalog||Games, movies & music||Music||Jazz music,Catalog||Games, movies & music||Music||Blues music,Catalog||Games, movies & music||Video||Television: series,Catalog||Games, movies & music||Music||Folk music,Catalog||Games, movies & music||Video||Miscellaneous,Catalog||Games, movies & music||Music||Popular music,Catalog||Games, movies & music||Music||New age music,Catalog||Games, movies & music||Music||Original cast recordings,Catalog||Games, movies & music||Video||Westerns,Catalog||Games, movies & music||Video||Horror,Catalog||Games, movies & music||Music||Music video: latin,Catalog||Games, movies & music||Music||Classical music,Catalog||Games, movies & music||Music||World music,Catalog||Games, movies & music||Music||Electronica";
byte[] encode = EncodingHelper.encodeBase64(value);// 1052
byte[] compress = CompressHelperWithoutPool.deflater(encode);
//
byte[] result = null;
int count = 10000;
for (int i = 0; i < count; i++) {
result = CompressHelperWithoutPool.inflater(compress);
}
System.out.println("length: " + result.length);
assertTrue(Arrays.equals(encode, result));
}
示例3: gzipBase64
import org.openyu.commons.lang.EncodingHelper; //导入方法依赖的package包/类
@Test
@BenchmarkOptions(benchmarkRounds = 3, warmupRounds = 2, concurrency = 1)
// round: 0.38
public void gzipBase64() throws Exception {
// 789
String value = "Catalog||Games, movies & music||Music||Childrens,Catalog||Games, movies & music||Music||Jazz music,Catalog||Games, movies & music||Music||Blues music,Catalog||Games, movies & music||Video||Television: series,Catalog||Games, movies & music||Music||Folk music,Catalog||Games, movies & music||Video||Miscellaneous,Catalog||Games, movies & music||Music||Popular music,Catalog||Games, movies & music||Music||New age music,Catalog||Games, movies & music||Music||Original cast recordings,Catalog||Games, movies & music||Video||Westerns,Catalog||Games, movies & music||Video||Horror,Catalog||Games, movies & music||Music||Music video: latin,Catalog||Games, movies & music||Music||Classical music,Catalog||Games, movies & music||Music||World music,Catalog||Games, movies & music||Music||Electronica";
byte[] encode = EncodingHelper.encodeBase64(value);// 1052
//
byte[] result = null;
int count = 10000;
for (int i = 0; i < count; i++) {
result = CompressHelperWithoutPool.gzip(encode);
}
System.out.println("length: " + result.length);// 340
assertEquals(340, result.length);
}
示例4: ungzipBase64
import org.openyu.commons.lang.EncodingHelper; //导入方法依赖的package包/类
@Test
@BenchmarkOptions(benchmarkRounds = 3, warmupRounds = 2, concurrency = 1)
// round: 0.13
public void ungzipBase64() throws Exception {
// 789
String value = "Catalog||Games, movies & music||Music||Childrens,Catalog||Games, movies & music||Music||Jazz music,Catalog||Games, movies & music||Music||Blues music,Catalog||Games, movies & music||Video||Television: series,Catalog||Games, movies & music||Music||Folk music,Catalog||Games, movies & music||Video||Miscellaneous,Catalog||Games, movies & music||Music||Popular music,Catalog||Games, movies & music||Music||New age music,Catalog||Games, movies & music||Music||Original cast recordings,Catalog||Games, movies & music||Video||Westerns,Catalog||Games, movies & music||Video||Horror,Catalog||Games, movies & music||Music||Music video: latin,Catalog||Games, movies & music||Music||Classical music,Catalog||Games, movies & music||Music||World music,Catalog||Games, movies & music||Music||Electronica";
byte[] encode = EncodingHelper.encodeBase64(value);// 1052
byte[] compress = CompressHelperWithoutPool.gzip(encode);
//
byte[] result = null;
int count = 10000;
for (int i = 0; i < count; i++) {
result = CompressHelperWithoutPool.ungzip(compress);
}
System.out.println("length: " + result.length);
assertTrue(Arrays.equals(encode, result));
}
示例5: deflateBase64
import org.openyu.commons.lang.EncodingHelper; //导入方法依赖的package包/类
@Test
@BenchmarkOptions(benchmarkRounds = 3, warmupRounds = 2, concurrency = 1)
// round: 0.38
public void deflateBase64() throws Exception {
// 789
String value = "Catalog||Games, movies & music||Music||Childrens,Catalog||Games, movies & music||Music||Jazz music,Catalog||Games, movies & music||Music||Blues music,Catalog||Games, movies & music||Video||Television: series,Catalog||Games, movies & music||Music||Folk music,Catalog||Games, movies & music||Video||Miscellaneous,Catalog||Games, movies & music||Music||Popular music,Catalog||Games, movies & music||Music||New age music,Catalog||Games, movies & music||Music||Original cast recordings,Catalog||Games, movies & music||Video||Westerns,Catalog||Games, movies & music||Video||Horror,Catalog||Games, movies & music||Music||Music video: latin,Catalog||Games, movies & music||Music||Classical music,Catalog||Games, movies & music||Music||World music,Catalog||Games, movies & music||Music||Electronica";
byte[] encode = EncodingHelper.encodeBase64(value);// 1052
//
byte[] result = null;
int count = 10000;
for (int i = 0; i < count; i++) {
result = CompressHelperWithoutPool.deflate(encode);
}
System.out.println("length: " + result.length);// 328
assertEquals(328, result.length);
}
示例6: inflateBase64
import org.openyu.commons.lang.EncodingHelper; //导入方法依赖的package包/类
@Test
@BenchmarkOptions(benchmarkRounds = 3, warmupRounds = 2, concurrency = 1)
// round: 0.13
public void inflateBase64() throws Exception {
// 789
String value = "Catalog||Games, movies & music||Music||Childrens,Catalog||Games, movies & music||Music||Jazz music,Catalog||Games, movies & music||Music||Blues music,Catalog||Games, movies & music||Video||Television: series,Catalog||Games, movies & music||Music||Folk music,Catalog||Games, movies & music||Video||Miscellaneous,Catalog||Games, movies & music||Music||Popular music,Catalog||Games, movies & music||Music||New age music,Catalog||Games, movies & music||Music||Original cast recordings,Catalog||Games, movies & music||Video||Westerns,Catalog||Games, movies & music||Video||Horror,Catalog||Games, movies & music||Music||Music video: latin,Catalog||Games, movies & music||Music||Classical music,Catalog||Games, movies & music||Music||World music,Catalog||Games, movies & music||Music||Electronica";
byte[] encode = EncodingHelper.encodeBase64(value);// 1052
byte[] compress = CompressHelperWithoutPool.deflate(encode);
//
byte[] result = null;
int count = 10000;
for (int i = 0; i < count; i++) {
result = CompressHelperWithoutPool.inflate(compress);
}
System.out.println("length: " + result.length);
assertTrue(Arrays.equals(encode, result));
}
示例7: deflaterBase64
import org.openyu.commons.lang.EncodingHelper; //导入方法依赖的package包/类
@Test
@BenchmarkOptions(benchmarkRounds = 3, warmupRounds = 2, concurrency = 1)
// round: 0.38
public void deflaterBase64() throws Exception {
// 789
String value = "Catalog||Games, movies & music||Music||Childrens,Catalog||Games, movies & music||Music||Jazz music,Catalog||Games, movies & music||Music||Blues music,Catalog||Games, movies & music||Video||Television: series,Catalog||Games, movies & music||Music||Folk music,Catalog||Games, movies & music||Video||Miscellaneous,Catalog||Games, movies & music||Music||Popular music,Catalog||Games, movies & music||Music||New age music,Catalog||Games, movies & music||Music||Original cast recordings,Catalog||Games, movies & music||Video||Westerns,Catalog||Games, movies & music||Video||Horror,Catalog||Games, movies & music||Music||Music video: latin,Catalog||Games, movies & music||Music||Classical music,Catalog||Games, movies & music||Music||World music,Catalog||Games, movies & music||Music||Electronica";
byte[] encode = EncodingHelper.encodeBase64(value);// 1052
//
byte[] result = null;
int count = 10000;
for (int i = 0; i < count; i++) {
result = CompressHelper.deflater(encode);
}
System.out.println("length: " + result.length);// 336
assertEquals(336, result.length);
}
示例8: inflaterBase64
import org.openyu.commons.lang.EncodingHelper; //导入方法依赖的package包/类
@Test
@BenchmarkOptions(benchmarkRounds = 3, warmupRounds = 2, concurrency = 1)
// round: 0.13
public void inflaterBase64() throws Exception {
// 789
String value = "Catalog||Games, movies & music||Music||Childrens,Catalog||Games, movies & music||Music||Jazz music,Catalog||Games, movies & music||Music||Blues music,Catalog||Games, movies & music||Video||Television: series,Catalog||Games, movies & music||Music||Folk music,Catalog||Games, movies & music||Video||Miscellaneous,Catalog||Games, movies & music||Music||Popular music,Catalog||Games, movies & music||Music||New age music,Catalog||Games, movies & music||Music||Original cast recordings,Catalog||Games, movies & music||Video||Westerns,Catalog||Games, movies & music||Video||Horror,Catalog||Games, movies & music||Music||Music video: latin,Catalog||Games, movies & music||Music||Classical music,Catalog||Games, movies & music||Music||World music,Catalog||Games, movies & music||Music||Electronica";
byte[] encode = EncodingHelper.encodeBase64(value);// 1052
byte[] compress = CompressHelper.deflater(encode);
//
byte[] result = null;
int count = 10000;
for (int i = 0; i < count; i++) {
result = CompressHelper.inflater(compress);
}
System.out.println("length: " + result.length);
assertTrue(Arrays.equals(encode, result));
}
示例9: gzipBase64
import org.openyu.commons.lang.EncodingHelper; //导入方法依赖的package包/类
@Test
@BenchmarkOptions(benchmarkRounds = 3, warmupRounds = 2, concurrency = 1)
// round: 0.38
public void gzipBase64() throws Exception {
// 789
String value = "Catalog||Games, movies & music||Music||Childrens,Catalog||Games, movies & music||Music||Jazz music,Catalog||Games, movies & music||Music||Blues music,Catalog||Games, movies & music||Video||Television: series,Catalog||Games, movies & music||Music||Folk music,Catalog||Games, movies & music||Video||Miscellaneous,Catalog||Games, movies & music||Music||Popular music,Catalog||Games, movies & music||Music||New age music,Catalog||Games, movies & music||Music||Original cast recordings,Catalog||Games, movies & music||Video||Westerns,Catalog||Games, movies & music||Video||Horror,Catalog||Games, movies & music||Music||Music video: latin,Catalog||Games, movies & music||Music||Classical music,Catalog||Games, movies & music||Music||World music,Catalog||Games, movies & music||Music||Electronica";
byte[] encode = EncodingHelper.encodeBase64(value);// 1052
//
byte[] result = null;
int count = 10000;
for (int i = 0; i < count; i++) {
result = CompressHelper.gzip(encode);
}
System.out.println("length: " + result.length);// 340
assertEquals(340, result.length);
}
示例10: ungzipBase64
import org.openyu.commons.lang.EncodingHelper; //导入方法依赖的package包/类
@Test
@BenchmarkOptions(benchmarkRounds = 3, warmupRounds = 2, concurrency = 1)
// round: 0.13
public void ungzipBase64() throws Exception {
// 789
String value = "Catalog||Games, movies & music||Music||Childrens,Catalog||Games, movies & music||Music||Jazz music,Catalog||Games, movies & music||Music||Blues music,Catalog||Games, movies & music||Video||Television: series,Catalog||Games, movies & music||Music||Folk music,Catalog||Games, movies & music||Video||Miscellaneous,Catalog||Games, movies & music||Music||Popular music,Catalog||Games, movies & music||Music||New age music,Catalog||Games, movies & music||Music||Original cast recordings,Catalog||Games, movies & music||Video||Westerns,Catalog||Games, movies & music||Video||Horror,Catalog||Games, movies & music||Music||Music video: latin,Catalog||Games, movies & music||Music||Classical music,Catalog||Games, movies & music||Music||World music,Catalog||Games, movies & music||Music||Electronica";
byte[] encode = EncodingHelper.encodeBase64(value);// 1052
byte[] compress = CompressHelper.gzip(encode);
//
byte[] result = null;
int count = 10000;
for (int i = 0; i < count; i++) {
result = CompressHelper.ungzip(compress);
}
System.out.println("length: " + result.length);
assertTrue(Arrays.equals(encode, result));
}
示例11: deflateBase64
import org.openyu.commons.lang.EncodingHelper; //导入方法依赖的package包/类
@Test
@BenchmarkOptions(benchmarkRounds = 3, warmupRounds = 2, concurrency = 1)
// round: 0.38
public void deflateBase64() throws Exception {
// 789
String value = "Catalog||Games, movies & music||Music||Childrens,Catalog||Games, movies & music||Music||Jazz music,Catalog||Games, movies & music||Music||Blues music,Catalog||Games, movies & music||Video||Television: series,Catalog||Games, movies & music||Music||Folk music,Catalog||Games, movies & music||Video||Miscellaneous,Catalog||Games, movies & music||Music||Popular music,Catalog||Games, movies & music||Music||New age music,Catalog||Games, movies & music||Music||Original cast recordings,Catalog||Games, movies & music||Video||Westerns,Catalog||Games, movies & music||Video||Horror,Catalog||Games, movies & music||Music||Music video: latin,Catalog||Games, movies & music||Music||Classical music,Catalog||Games, movies & music||Music||World music,Catalog||Games, movies & music||Music||Electronica";
byte[] encode = EncodingHelper.encodeBase64(value);// 1052
//
byte[] result = null;
int count = 10000;
for (int i = 0; i < count; i++) {
result = CompressHelper.deflate(encode);
}
System.out.println("length: " + result.length);// 328
assertEquals(328, result.length);
}
示例12: inflateBase64
import org.openyu.commons.lang.EncodingHelper; //导入方法依赖的package包/类
@Test
@BenchmarkOptions(benchmarkRounds = 3, warmupRounds = 2, concurrency = 1)
// round: 0.13
public void inflateBase64() throws Exception {
// 789
String value = "Catalog||Games, movies & music||Music||Childrens,Catalog||Games, movies & music||Music||Jazz music,Catalog||Games, movies & music||Music||Blues music,Catalog||Games, movies & music||Video||Television: series,Catalog||Games, movies & music||Music||Folk music,Catalog||Games, movies & music||Video||Miscellaneous,Catalog||Games, movies & music||Music||Popular music,Catalog||Games, movies & music||Music||New age music,Catalog||Games, movies & music||Music||Original cast recordings,Catalog||Games, movies & music||Video||Westerns,Catalog||Games, movies & music||Video||Horror,Catalog||Games, movies & music||Music||Music video: latin,Catalog||Games, movies & music||Music||Classical music,Catalog||Games, movies & music||Music||World music,Catalog||Games, movies & music||Music||Electronica";
byte[] encode = EncodingHelper.encodeBase64(value);// 1052
byte[] compress = CompressHelper.deflate(encode);
//
byte[] result = null;
int count = 10000;
for (int i = 0; i < count; i++) {
result = CompressHelper.inflate(compress);
}
System.out.println("length: " + result.length);
assertTrue(Arrays.equals(encode, result));
}