File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ package io ;
2+
3+ import java .io .BufferedReader ;
4+ import java .io .BufferedWriter ;
5+ import java .io .FileOutputStream ;
6+ import java .io .FileReader ;
7+ import java .io .IOException ;
8+ import java .io .OutputStreamWriter ;
9+
10+ public class TextToOtherType {
11+
12+ public static void main (String [] args ) {
13+ BufferedReader bfr =null ;
14+ BufferedWriter bfw =null ;
15+ try {
16+ bfr =new BufferedReader (new FileReader ("tempfile/abc.txt" ));
17+ bfw =new BufferedWriter (new OutputStreamWriter (new FileOutputStream ("tempfile/abc_utf-8.txt" ), "utf-8" ));
18+ String len =null ;
19+ while ((len =bfr .readLine ())!=null ){
20+ bfw .write (len );
21+ bfw .newLine ();
22+ bfw .flush ();
23+ }
24+ } catch (IOException e ) {
25+ e .printStackTrace ();
26+ }finally {
27+ if (bfr !=null ){
28+ try {
29+ bfr .close ();
30+ } catch (IOException e ) {
31+ e .printStackTrace ();
32+ }
33+ }
34+ if (bfw !=null ){
35+ try {
36+ bfw .close ();
37+ } catch (IOException e ) {
38+ e .printStackTrace ();
39+ }
40+ }
41+ }
42+ }
43+
44+ }
Original file line number Diff line number Diff line change 1+ c这话i是哦撒还哦好覅哦怕那次吧uav;
2+ 分理处你团我从来就m
3+
You can’t perform that action at this time.
0 commit comments