关于Eclipse无法关联出Base64Encoder以及相类似的类的解决方案

今天玩那个啥程序员光棍节的游戏, 后面需要用到Base64解码.

我拿eclipse写程序准备搞的,  死活找不到这个Base64Decoder, 但是我Ctrl+Shift+T又可以关联出来源码.

于是我郁闷了.. google了把,  发现这个玩意是eclipse给过滤了的(跟android过滤了internal包下面的API的一样的道理)

google了一把,  终于找到解决方案, 首先感谢这个哥们.

http://blog.csdn.net/jpr1990/article/details/6688129


具体方法不再重述, 请看原文.!


另外. java的同学. 我给出第九题的java程序, 希望大家都可以通关!

大家先做好准备工作, 首先查看第九关的源文件, 把pre标签里面的东西保存在文件, 我这里叫nine.txt, 然后把所有的"_"替换为1,与下面的类放在一个文件夹下就可以了

public class Test {
	public static void main(String[] args) throws Exception {
		InputStream in = Test.class.getResourceAsStream("nine.txt");
		BufferedReader reader = new BufferedReader(new InputStreamReader(in));
		String everyLine = null;
		StringBuilder sBuilder = new StringBuilder();
		while((everyLine = reader.readLine()) != null) {
			for(String s : temp) {
				sBuilder.append((char)Integer.parseInt(s, 2));
			}
		}
		//System.out.println(sBuilder.toString());
		BASE64Decoder d = new BASE64Decoder();
		byte[] decoders = d.decodeBuffer(sBuilder.toString());
		OutputStream ops = new FileOutputStream(new File("result.tar.gz"));
		ops.write(decoders);
		ops.flush();
		ops.close();
	}
}


猜你喜欢

转载自blog.csdn.net/izard999/article/details/8175120