Hiện nay dự án đầu tiên của bạn là một ứng dụng Java sử dụng một cầu nối JDBC-ODBC để kết nối với một tập tin truy cập. Các tập tin truy cập cho dự án này là , một cơ sở dữ liệu thống kê năng lượng thế giới được công bố của Cục Quản lý Thông tin Năng lượng Mỹ | 416 SimpoJPDFoMergetandS plit Unregistered Version - http LISTING 1Ỉ Continued 39 40 return true 41 catch IOException e 42 Exception 43 return false 44 45 46 47 boolean readStream 48 try 49 FileInputStream file new 50 FileInputStream 51 BufferedInputStream buff new 52 BufferedlnputStream file 53 int in 0 54 do 55 in 56 if in -1 57 in 58 while in -1 59 60 return true 61 catch IOException e 62 Exception 63 return false 64 65 66 This program s output depends on the two arguments specified when it was run. If you use 4 and 13 the following output is shown Writing 4 5 6 7 8 9 10 11 12 13 Reading 4 5 6 7 8 9 10 11 12 13 This application consists of two classes BufferDemo and a helper class called ArgStream. BufferDemo gets the two arguments values if they are provided and uses them in the ArgStream constructor. The writeStream method of ArgStream is called in line 14 to write the series of bytes to a buffered output stream and the readStream method is called in line 16 to read those bytes back. Simpo PDF Merge and Split Unregistered Version - http Even though they are moving data in two directions the writeStream and readStream methods are substantially the same. They take the following format The filename is used to create a file input or output stream. The file stream is used to create a buffered input or output stream. 15 The buffered stream s write method is used to send data or the read method is used to receive data. The buffered stream is closed. Because file streams and buffered streams throw lOException objects if an error occurs all operations involving the streams are enclosed in a try-catch block for this exception. HP The Boolean return values in writeStream and readStream indicate whether the stream operation was completed successfully. They aren t used in this program but it s good .