@Test
public void testBufferRead() throws IOException {

	UnsyncCharArrayReader unsyncCharArrayReader = new UnsyncCharArrayReader(
		_BUFFER);
	int size = _SIZE * 2 / 3;
	CharBuffer charBuffer = CharBuffer.allocate(size);
	int read = unsyncCharArrayReader.read(charBuffer);
	Assert.assertEquals(size, read);
	for (int i = 0; i < read; i++) {
		Assert.assertEquals('a' + i, charBuffer.get(i));
	}
	charBuffer.position(0);
	read = unsyncCharArrayReader.read(charBuffer);
	Assert.assertEquals(_SIZE - size, read);
	for (int i = 0; i < read; i++) {
		Assert.assertEquals('a' + i + size, charBuffer.get(i));
	}
	charBuffer.position(charBuffer.limit());
	Assert.assertEquals(0, unsyncCharArrayReader.read(charBuffer));
	charBuffer.position(0);
	Assert.assertEquals(-1, unsyncCharArrayReader.read(charBuffer));
}