How to assign file content into a variable in Java
Most people will read the file content and assign to StringBuffer or String line by line. Here’s another trick that may interest you – how to assign whole file content into a variable with one Java’s statement, try it 🙂 Example In this example, you will use DataInputStreamto convert all the content into bytes, and …