tailieunhanh - java programming language basics phần 4

Vì vậy, đến nay các ví dụ đã cho thấy làm thế nào để đọc và viết ra các dòng dữ liệu Ví dụ 1 thiết lập một máy khách và máy chủ truyền thông giữa một chương trình máy chủ và chương trình khách hàng. | Java TM Language Basics Part 1 Lesson 6 File Access and Permissions http Programming BasicJava1 try Code to write to file String outputFileName home monicap File outputFile new File outputFileName FileWriter fout new FileWriter outputFile DATA Code to read from file String inputFileName home monicap File inputFile new File inputFileName FileReader fin new FileReader inputFile char c new char char int i i c String s new String c P STRONG Text from file STRONG s catch e Cannot access P Return to A HREF . Form A Appending So far the examples have shown you how to read in and write out streams of data in their entirety. But often you want to append data to an existing file or read in only certain amounts. Using the RandomAccessFile class alter the class to append to the file. Give it a try before taking a peek at the Solution. More Information For more infomation on file input and output see the Reading and Writing trail in The Java Tutorial. You can learn more about component sizing in The Java Tutorial sections on Solving Common Layout Problems and Layout Management. 11 of 12 21-04-2000 17 32 Java TM Language Basics Part 1 Lesson 6 File Access and Permissions http Programming BasicJava1 Printable Page TOP This page was updated 11-Apr-2000 Products APIs Developer Connection Docs Training Online Support Community Discussion Industry News Solutions Marketplace Case Studies Glossary - Applets - Tutorial - Employment - Business Licensing - Java Store - Java in the Real World FAQ Feedback Map A-Z Index For more

TỪ KHÓA LIÊN QUAN