将字符串转换为二进制,然后反向转换 [英] converting a string into binary and then its reverse
本文介绍了将字符串转换为二进制,然后反向转换的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我需要一些帮助.
我在编码时遇到了一些问题.
我想通过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 usingFileInputStream
and write it back usingFileOutputStream
. Have a look at the link for more info.
http://docs.oracle.com/javase/tutorial/essential/io/[^]
Good luck!
这篇关于将字符串转换为二进制,然后反向转换的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文