the several ways of Base64

原创 2004年08月20日 09:47:00

import java.io.*;
import sun.misc.*;

public class DeEnBase64{
 public static void main(String args[]) throws Exception{

  File f=new File("C:/aa.bmp");
  FileInputStream fis=new FileInputStream(f);
  FileOutputStream fos=new FileOutputStream("c:/bb.bmp");
  
  byte[] by=new byte[(int)f.length()];
  fis.read(by);
  
  //from soap.jar;
  //String s=new org.apache.soap.encoding.soapenc.Base64().encode(by);
  //from axis.jar;
  String s=new org.apache.axis.encoding.Base64().encode(by);
  
  //from standard jdk;
  //String s=new sun.misc.BASE64Encoder().encode(by);

  fos.write(new BASE64Decoder().decodeBuffer(s));
  System.out.println(s.length());  
  
 }
}

UVA - 12034 Race

Description Tamim and Lina, two of the biggest mega minds of Bangladesh went to a far country. Th...
  • u011345136
  • u011345136
  • 2014-08-15 12:15:21
  • 946

Code Optimization

  • 2013年04月28日 17:51
  • 114KB
  • 下载

several ways to solve np-complete problems

At present, all known algorithms for NP-complete problems require time that is superpolynomial in th...
  • shenlan211314
  • shenlan211314
  • 2011-04-11 21:14:00
  • 861

perl: read in files in several ways

#!/opt/VRTSperl/bin/perl -wuse strict;my $file = shift;print "==================read file line by li...
  • wenchenzhao113
  • wenchenzhao113
  • 2009-12-09 16:07:00
  • 325

Leetcode Decode Ways 解题报告

A message containing letters from A-Z is being encoded to numbers using the following mapping: 'A' -...
  • worldwindjp
  • worldwindjp
  • 2014-02-25 23:06:03
  • 17258

Leetcode 91. Decode Ways 路线解析 解题报告

1 解题思想意思是原来二十六个字母,可以编码成数字,数字正好对应他们的顺序。现在我只知道数字,问说有几种可能字母组成的方式这道题只能不停的递归查找,回溯2 原题A message containing...
  • MebiuW
  • MebiuW
  • 2016-07-08 20:31:55
  • 912

LeetCode 91 Decode Ways (Python详解及实现)

【题目】 Amessage containing letters from A-Z is being encoded to numbers using thefollowing mapping: ...
  • yangjingjing9
  • yangjingjing9
  • 2017-08-10 10:18:48
  • 212

hdu 1978 How many ways (动态规划、记忆化搜索)

How many ways Time Limit: 3000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) ...
  • u011721440
  • u011721440
  • 2014-09-26 10:09:10
  • 1079

An Introduction to Interactive Programming in Python (Part 1) - Week 1

An Introduction to Interactive Programming in Python (Part 1) - Week 1
  • xiewen99
  • xiewen99
  • 2016-10-10 13:33:28
  • 966

leetcode 241. Different Ways to Add Parentheses-分治算法

原题链接:241. Different Ways to Add Parentheses 【思路-Java】 递归实现 采用分治算法,分治算法的基本思想是将一个规模为N的问题分解为K个规模较小的子问题,...
  • happyaaaaaaaaaaa
  • happyaaaaaaaaaaa
  • 2016-05-30 15:12:21
  • 1985
收藏助手
不良信息举报
您举报文章:the several ways of Base64
举报原因:
原因补充:

(最多只允许输入30个字)