Linux -Blue forest free software | Return to home page | Site Map | Search WWW | Contact Us |
Your current position : Homepage > Free Software > Technological exchanges >Application Programming


    

Blue Forest http://www.lslnet.com at 10:18 on June 6, 2006


Reading the document java (FileReader)

Code :
MyFileReader=new FileReader (cmdmx);

MyBufferedReader=new BufferedReader (myFileReader);

If ((myString=myBufferedReader.readLine ()) !=null) {wjnr=myString;}

MyFileReader.close ();

Encountered read the code for this trip is not only his time

How it all reading of this document?

Reading the document java (FileReader)

Originally, the data is read into his readLine way, I do not see your code Lane part cycle time.

Reading the document java (FileReader)

Not into the whole time I wrote this is not necessarily based on certain codes ah

Otherwise, or any other parameter is the only time his writing circle

Reading the document java (FileReader)

Http://www.javaalmanac.com/egs/java.io/ReadLinesFromFile.html

Reading the document java (FileReader)

In this way the content of the original document is read from one system?

If the original document is a Huanxingfu can put together read memory Huanhangfu

If no other means?

Completely loyal to read out the content of the original document

Reading the document java (FileReader)

If ((myString=myBufferedReader.readLine ()) !=null) {wjnr=myString;}
If it can be put into full time in a while, but one trip each CD, you can use StringBuffer

[code]StringBuffer Strb = new StringBuffer ();

While ((myString=myBufferedReader.readLine ()) !=null)
{
Strb.append (myString);
Strb.append ( "\n"); 4003rd because readLine would eliminate Huanxingfu, require manual accession
}
String content = strb.toString () ;[/code]

If fully finally source document, it had not used read?

[code]int C
While ((c=myBufferedReader.read ()) "shape noted by 0)
{
Strb.append (c);
}
String content = strb.toString () ;[/code]

Reading the document java (FileReader)

Use read () read out to them how the code is asc type String

For instance, wrote a paper in 1997 on a StringBuffer, was read out "97"

He showed how to use a byte into?

Reading the document java (FileReader)

[code]int C
While ((c=myBufferedReader.read ()) "shape noted by 0)
{
Strb.append ((char) c);
}
String content = strb.toString () ;[/code]

Reading the document java (FileReader)

If you want to be the first to finish a ah,

[code]
InputStream in==. .
Int len=in.available ();
Byte[] content=new byte[len];
In.read (content);

//transform To string
String str=new String (content, "" charset>; ");
[/code]

Reading the document java (FileReader)

Theoretically can be made, was to prevent the documents section to read too much memory read all the documents will lead to machines used up memory, resulting in system performance or even crash, of course, a byte is a byte is not the best reading program, the better approach is to use a small buffer, similar to this example http : //www.javaalmanac.com/egs/java.io/CopyFile.html

Reading the document java (FileReader)

MyFileReader=new FileReader (path);

If the writing path relative to the path to class or how to write ah. Java done Reference ah



 Privacy Policy  Copyright © 1999-2000 LSLNET.COM. All rights reserved. Blue Forest website owners. E-mail : Webmaster@lslnet.com