public void dump(DumpSource ds) {
		num.setLength(0);
		txt.setLength(0);

		offset = 0;
		
		try {
			int b = 0;
			int column = 0;

			while ((b=ds.get()) != -1) {				
				num.append(String.format("%02x", b & 0xff));
				num.append(' ');
				txt.append(Character.isLetterOrDigit((char)b) ? (char)b : '.');

				if (++column % BYTES_PER_LINE == 0) {
					endOfLine();
				}
			}
			for ( ; column % BYTES_PER_LINE != 0 ; column++) {
				num.append("   ");
			}
			// if partial line, output it.
			if (++column % BYTES_PER_LINE != 0) {
				endOfLine();
			}
			System.out.println();
		} catch (IOException ex) {
			System.out.println("Dumper: " + ex.toString());
		}
	}