Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fragamus/68405a42ca7f85d887573edf3dcfc5f0 to your computer and use it in GitHub Desktop.
Save fragamus/68405a42ca7f85d887573edf3dcfc5f0 to your computer and use it in GitHub Desktop.
public static String pingPongBallToStringThatIsBothMachineReadableAndHumanReadable(PingPongBall a){
Function<PingPongBall,byte[]> funky = x -> x.toByteArray();
return funky
.andThen(x->Base64.getEncoder().encode(x))
.andThen(x->x+"\n"+a)
.apply(a);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment