@Test
public void testRead() throws IOException {

	int size = 10;
	ByteArrayInputStream byteArrayInputStream = new ByteArrayInputStream(
		_BUFFER);
	UnsyncBufferedInputStream unsyncBufferedInputStream =
		new UnsyncBufferedInputStream(byteArrayInputStream, size);
	Assert.assertEquals(_SIZE, byteArrayInputStream.available());
	Assert.assertEquals(_SIZE, unsyncBufferedInputStream.available());
	Assert.assertEquals(0, unsyncBufferedInputStream.read());
	Assert.assertEquals(_SIZE - size, byteArrayInputStream.available());
	Assert.assertEquals(_SIZE - 1, unsyncBufferedInputStream.available());
	for (int i = 1; i < (size + 1); i++) {
		Assert.assertEquals(i, unsyncBufferedInputStream.read());
	}
	Assert.assertEquals(
		_SIZE - (size * 2), byteArrayInputStream.available());
	Assert.assertEquals(
		_SIZE - size - 1, unsyncBufferedInputStream.available());
	for (int i = size + 1; i < _SIZE; i++) {
		Assert.assertEquals(
			(byte)i, (byte)unsyncBufferedInputStream.read());
	}
	Assert.assertEquals(-1, unsyncBufferedInputStream.read());
}