@Test
public void testReadObjectString() throws ClassNotFoundException {

	String asciiString = "abcdefghijklmn";
	byte[] buffer = new byte[asciiString.length() + 6];
	buffer[0] = SerializationConstants.TC_STRING;
	buffer[1] = 1;
	BigEndianCodec.putInt(buffer, 2, asciiString.length());
	for (int i = 0; i < asciiString.length(); i++) {
		buffer[6 + i] = (byte)asciiString.charAt(i);
	}
	ByteBuffer byteBuffer = ByteBuffer.wrap(buffer);
	Deserializer deserializer = new Deserializer(byteBuffer);
	Object object = deserializer.readObject();
	Assert.assertTrue(object instanceof String);
	Assert.assertEquals(asciiString, object);
	String nonasciiString = "非ASCII Code中文测试";
	buffer = new byte[(nonasciiString.length() * 2) + 6];
	buffer[0] = SerializationConstants.TC_STRING;
	buffer[1] = 0;
	BigEndianCodec.putInt(buffer, 2, nonasciiString.length());
	for (int i = 0; i < nonasciiString.length(); i++) {
		BigEndianCodec.putChar(
			buffer, 6 + (i * 2), nonasciiString.charAt(i));
	}
	byteBuffer = ByteBuffer.wrap(buffer);
	deserializer = new Deserializer(byteBuffer);
	object = deserializer.readObject();
	Assert.assertTrue(object instanceof String);
	Assert.assertEquals(nonasciiString, object);
}