public static void ascii(final ByteBuffer buffer, final StringBuilder out)
    {
    	final int start = buffer.position();
    	final int end = buffer.limit();
    	for (int pos = 0; pos < end; pos += ELEMENTS_PER_LINE)
    	{
    		out.append(String.format("%04X - ", pos));
    		for (int i=0; i<ELEMENTS_PER_LINE; ++i)
    		{
    			final int idx = start + pos + i;
    			if (idx >= end)
    				out.append(" ");
    			else
    				out.append(escapeChars(buffer.get(idx)));
    		}
    		out.append("\n");
    	}
    	buffer.rewind();
    }