@Test
    public void testBasicEncoding() throws IOException {
		Bin2Hex encoder = new Bin2Hex();
		byte[] inputBuffer = new byte[256];
		byte[] answer = new byte[(256*3) - 1];
		ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
		ByteArrayInputStream inputStream;

		for (int index = 0; index < 256; index++) {
			inputBuffer[index] = (byte) index;
		}

		for (int ansHigh = 0; ansHigh < 16; ansHigh++) {
			for (int ansLow = 0; ansLow < 16; ansLow++) {
				if (ansHigh < 10) {
					answer[((ansHigh*16) + ansLow) * 3] = (byte)(ansHigh + '0');
				} else {
					answer[((ansHigh*16) + ansLow) * 3] = (byte)((ansHigh-10) + 'a');
				}

				if (ansLow < 10) {
					answer[(((ansHigh*16) + ansLow) * 3) + 1] = (byte)(ansLow + '0');
				} else {
					answer[(((ansHigh*16) + ansLow) * 3) + 1] = (byte)((ansLow-10) + 'a');
				}

				if ((ansHigh != 15) || (ansLow != 15)) {
					answer[(((ansHigh*16) + ansLow) * 3) + 2] = ' ';
				}
			}
		}

		inputStream = new ByteArrayInputStream(inputBuffer);

		encoder.convert(inputStream, outputStream);

		byte[] output = outputStream.toByteArray();
		assertArrayEquals(answer, output);
	}