将字符串转换为二进制,然后反向转换 [英] converting a string into binary and then its reverse

查看:103
本文介绍了将字符串转换为二进制,然后反向转换的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要一些帮助.
我在编码时遇到了一些问题.
我想通过jfilechooser将文件作为输入.
然后,我想将此文件内容转换为二进制值,对其进行一些操作.然后将其转换回原始文件...

I need some help.
I''m facing some problem in coding.
I want to take file as input through jfilechooser.
Then I want to convert this file content into binary value, apply some operations on it. And then converting it back into the original file...

推荐答案

您需要使用给定的文件名(jfilechooser.getSelectedFile().getName())读取文件,并使用FileInputStream读取文件并使用FileOutputStream将其写回.请查看该链接以获取更多信息.
http://docs.oracle.com/javase/tutorial/essential/io/ [ ^ ]

祝你好运!
You need to read file using the given filename (jfilechooser.getSelectedFile().getName()) and read it using FileInputStream and write it back using FileOutputStream. Have a look at the link for more info.
http://docs.oracle.com/javase/tutorial/essential/io/[^]

Good luck!


这篇关于将字符串转换为二进制,然后反向转换的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆