This week's book giveaway is in the Mac OS forum. We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell on-line! See this thread for details.
1. Create a new StringBuffer object 2. Create an array of 4096 bytes 3. Loop: Read some data into the byte array, assign the number of bytes read to n, do this until n == -1 (which means the end of the input stream has been reached) 4. Inside the loop: Create a new String object from the bytes read (bytes 0 to n-1 in the array) and append the string to the StringBuffer object 5. After the loop, return the contents of the StringBuffer as a String 6. Exception handling code: If an exception occurs, print the stack trace and return null as the result