List of usage examples for com.google.common.base Ascii LF
byte LF
To view the source code for com.google.common.base Ascii LF.
Click Source Link
From source file:se.softhouse.jargo.api.GreetingServer.java
void start(boolean loggingIsEnabled, List<Integer> ports, List<String> greetingPhrases) { if (loggingIsEnabled) { System.out.println(//from w w w . ja v a2s .c o m "Starting server on port " + ports + ", will greet new connections with " + greetingPhrases); } try { for (Integer port : ports) { ServerSocket server = new ServerSocket(port, 10000); Socket client = server.accept(); Writer writer = new OutputStreamWriter(client.getOutputStream(), Charsets.UTF_8); for (String greetingPhrase : greetingPhrases) { writer.append(greetingPhrase).append((char) Ascii.LF); } writer.close(); } } catch (IOException e) { throw new RuntimeException("Bad shit happened", e); } }