Skip to content

Instantly share code, notes, and snippets.

@tlberglund
Created June 20, 2012 23:02
Show Gist options
  • Select an option

  • Save tlberglund/2962787 to your computer and use it in GitHub Desktop.

Select an option

Save tlberglund/2962787 to your computer and use it in GitHub Desktop.
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