davidraviv
5/19/2014 - 12:52 PM

From http://stackoverflow.com/questions/3886201/java-outputting-text-file-to-console Print the content of a text file to the console. I used

From http://stackoverflow.com/questions/3886201/java-outputting-text-file-to-console Print the content of a text file to the console. I used it to print a logo.

try {
			// draw logo to console
			InputStream input = new BufferedInputStream(new FileInputStream("src/main/resources/logo.txt"));
			byte[] buffer = new byte[8192];

			try {
				for (int length = 0; (length = input.read(buffer)) != -1;) {
					System.out.write(buffer, 0, length);
				}
			} finally {
				input.close();
			}
		} catch (IOException e) {
			logger.warn("Failed to draw logo file: " + e.getMessage());
		}