Created
June 20, 2012 23:02
-
-
Save tlberglund/2962787 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package com.nofluff.poetry; | |
| import java.util.ArrayList; | |
| import java.util.List; | |
| import org.apache.commons.codec.binary.Base64; | |
| public class PoetryEmitter { | |
| public List<String> theMaven() { | |
| List<String> lines = new ArrayList<String>(); | |
| lines.add("'Wretch!' I cried. 'VanZyl hath sent you! By these downloads he hath lent you"); | |
| lines.add("Respite, respite and some Red Bull..."); | |
| return lines; | |
| } | |
| public String encode(String text) { | |
| Base64 codec = new Base64(); | |
| return new String(codec.encode(text.getBytes())); | |
| } | |
| public void emit(List<String> lines) { | |
| for(String line : lines) { | |
| System.out.println(encode(line)); | |
| } | |
| } | |
| public static void main(String[] args) { | |
| PoetryEmitter pe = new PoetryEmitter(); | |
| pe.emit(pe.theMaven()); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment