Simple XXD Style output from a ByteBuffer. Refactored here without testing, so probably no-longer compiles - but should be a good starting point should I need it again.