dataoutputstream.
Inputstreamreader and inputstreamwriter are used to convert a byte stream to a bytes stream based on the specified character sequence set, for example:
Inputstreamreader in = new inputstreamreader (system. in, "gb2312"); outputstreamwriter out = new outputstreamwriter (system. out, "gb2312"). For example, the following sample Java encoding meets the requirements:
// Read. JavaImport java. Io .*;Public class read{Public static void main (string [] ARGs)Throws ioexception{String
1. Reading and Writing from one file to another
Public static void main (string [] ARGs )...{
Try ...{
File rfile = new file ("E:/test/text1.txt ");
File wfile = new file ("E:/test/text2.txt ");
Bufferedreader BR = new bufferedreader (New filereader (rfile ));
Bufferedwriter BW = new bufferedwriter (New filewriter (wfile, true);/* If this parameter is set to false, the original content of text2.txt is overwritten */
String tempstr = Br. Readline ();
While (tempstr! = NULL)
...{
// BW. Write (
Finally, I implemented it using C ++ because STL does not contain the Regular Expression, so I used the Regex ++ in Boost. But because it is not very familiar, the code is very poor and I will read it. Haha.
# Include # Include # Include # Include
Using namespace std;
Void readFile (const char * filename, string str );Void writeFile (const char * filename, const string str );Void filter (const string input, string output );
Int main (int argc, const char * argv []){If (argc {Cout Return 1;}S
(szbuf, Str );Delete [] szbuf;}Note: This function will prompt during compilationWarning c4244: '=': conversion from 'unsigned short 'to 'Char', possible loss of dataDon't worry about it. We don't need the lost data.========================================================== ========================================================== ===//////////////////////////////////////// //////////////////////////////////////// /////////// Convert a char character to a Unicode CharacterInt chartounicode (c
,bufferedoutputstreamInputstreamreader,outputstreamwriterThe processing flow of its byte type is: Datainputstream,dataoutputstreamWhere InputStreamReader and inputstreamwriter are used to convert a byte stream to a character string according to the specified set of characters, such as:InputStreamReader in = new InputStreamReader (system.in, "Gb2312″"); OutputStreamWriter out = new OutputStreamWriter ( System.out, "Gb2312″": for example, the following sample Java encoding is required:Read.javaImp
following sample Java encoding is required:
//read.java import java.io.*; public class Read { public static void Main (string[] args) throws IOException { string str = "\ n Chinese test, this is the internal hard-coded string" + "\ntest 中文版 character"; String strin= ""; BufferedReader stdin = new BufferedReader (new InputStreamReader (system.in, "gb2312")); Set input interface by Chinese encoding bufferedwriter stdout = new BufferedWriter
cannot be recovered. At this moment, a monk passed by and found a mirror in his arms to call the scholar. The scholar saw a woman lying down on the beach. One person passed,A glance, shaking his head, and leaving. Another person passed by, took off his clothes, covered the female, and left. Another person passed by. He used to dig a hole,Carefully buried the body. The monk explained,The female on the beach
How to move Mt. Fuji? This is an interview question that Bill Gates posed to college graduates eager to apply for a Microsoft Company. In this regard, Bill Gates explained that there is no fixed and correct answer. I just want to know whether these young people are thinking in the correct way of thinking.
The smartest choice
A young man felt that he was not lucky. An old man listened to his experiences and threw a grain of sand on the beach and said,
Noon 12: 15 We follow Jim Slave SAPI Depart from the island and take a speedboat Manukan Island. Got off the ship, Jim He said there were 1 A table is owned by him every day. We can put our bags there and play anywhere we like.
ManukanThe so-called bathroom ratio on the islandSAPIThe island is a little dirty, I think. However, it is impossible to take a bath in the bathroom on the island. Take a break after lunch.
The island is quiet. Tourists may bask in the sun on
Accompaniment of the movie "Liu sanjie" Lei zhenbang Qu Qiao Yu CI changying orchestra
Liu sanjie: on the top of the mountain is fragrant with flowers and feet, and there is a cooling bridge deck at the bottom of the bridge; there is an injustice in the heart, the song is like fire out of the chest; there is an injustice in the heart, the song is like fire out of the chest; the song is like a spring water stream, and there are Shen Shan lailin everywhere; if there are people to block, break thro
Cable
The Internet exists due to thousands of meters of heavy and worn-out cable connections. The long submarine cable connects various continents and makes the world a whole. As mentioned earlier, optical fiber cables can be connected to each other. When one is disconnected, the other will start the task. What if we cut them all?
The Internet is a network with cables. Home computers, office equipment, and foreign servers are all connected through these cables. After these connections are cut
One grain of sand at a time, one thing at a time
To overcome the pressure of daily life, one thing at a time is the best way to deal with it. -- Hei liyan
One day, a boy was playing on the beach. As the tide surges, starfish are scattered on the beach, and the colors are brilliant and spectacular. The little boy is happy to run while enjoying this rare adventure. Soon after, he saw a person from far away w
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.