Before you write, declare that I am very vegetable, and very lazy.
For a reason, look at the reasons first.
I want to pass a file through the network from Java to C #, because I am lazy, choose the Web service, and just want to pass the simple type, so I think of Base64, so I decided to use the Base64 code after the Java to provide Web service, called by C #.
Must first into the Base64 code bar, with Java will not be compiled, choose the C # code, have to save into a text file, read in Java, compared to, from reading text files.
C#:
StreamReader reader = File.OpenText ("C://data.txt");
This.buffer = reader. ReadToEnd ();
Java:
BufferedReader reader = new BufferedReader (New FileReader ("C://data.txt"));
return Reader.readline ();
See here, I really depressed,. NET can read all, and Java can read only one line, in. Net thinking very clear, to read the file, definitely to files, do what. File.Open ..., ah, from the IDE's tip I found OpenText, this is what I want, bless me is the filename of a string ... bingo ... I guessed the excitement to add the filename into the File.OpenText ("C://data.txt"), at the beginning I wrote this, This.buffer = File.OpenText ("C://data.txt"). ReadToEnd (); Because I ordered it again. The IDE gave me a hint, and I found ReadToEnd (), and later because I wanted to reader. Close (), so separate, which is also a logical thing to do, with VS programming, as in dialogue with it.
Java is very depressing, reader is not readall only ReadLine, I was confused, so open Help JB Help, with the Java API, find ReadAll, The result is what image. What, let alone how to use Java code base64.
I do not want to comment who good who bad, maybe really I am too lazy, I kind of like on C #.
In addition, in C # reading text, it is easy to read, and the Java Reader.readline (), incredibly let my jb stop responding, oh, maybe really don't blame Java, my line is too long, 2M so long: O.