Valid 1Z0-804 Dumps shared by ExamDiscuss.com for Helping Passing 1Z0-804 Exam! ExamDiscuss.com now offer the newest 1Z0-804 exam dumps, the ExamDiscuss.com 1Z0-804 exam questions have been updated and answers have been corrected get the newest ExamDiscuss.com 1Z0-804 dumps with Test Engine here:
Given the existing destination file, a source file only 1000 bytes long, and the code fragment: What is the result?
Correct Answer: A
Explanation/Reference: Explanation: The whole of the FileInputStream will be read (see ** below). The content of the FileInputStream will overwrite the destination file (see *** below). *A FileInputStream obtains input bytes from a file in a file system. What files are available depends on the host environment. FileInputStream is meant for reading streams of raw bytes such as image data. For reading streams of characters, consider using FileReader. **FileInputStream.read(byte[] b) Reads up to b.length bytes of data from this input stream into an array of bytes. Parameters: b - the buffer into which the data is read. Returns: the total number of bytes read into the buffer, or -1 if there is no more data because the end of the file has been reached. ***FileOutputStream You can construct a FileOutputStream object by passing a string containing a path name or a File object. You can also specify whether you want to append the output to an existing file. public FileOutputStream (String path) public FileOutputStream (String path, boolean append) public FileOutputStream (File file) public FileOutputStream (File file, boolean append) With the first and third constructors, if a file by the specified name already exists, the file will be overwritten. To append to an existing file, pass true to the second or fourth constructor. Reference:Class FileInputStream Reference:Class FileOutputStream