Java Code Examples for org.msgpack.unpacker.Converter#close()

The following examples show how to use org.msgpack.unpacker.Converter#close() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: GeneralMesseageConsumer.java    From laser with Apache License 2.0 6 votes vote down vote up
private boolean setItemProfile(String title, Vector profile) {
	try {
		Object[] req = new Object[1];
		req[0] = title;
		Value res = msgpackClient.read(req, "splitTitle");
		Converter converter = new org.msgpack.unpacker.Converter(res);
		SparseVector vec = converter.read(SparseVector.class);
		converter.close();

		while (vec.hasNext()) {
			profile.set(vec.getIndex(), vec.get());
		}
	} catch (Exception e) {
		return false;
	}
	return true;
}
 
Example 2
Source File: MsgpackClient.java    From laser with Apache License 2.0 5 votes vote down vote up
public Object asyncRead(Object[] req, String method, Class<?> valueClass)
		throws IOException {
	Value vaule = asyncRead(req, method);
	if (null == vaule) {
		return null;
	}
	Converter converter = new org.msgpack.unpacker.Converter(vaule);
	Object ret = converter.read(valueClass);
	converter.close();
	return ret;
}
 
Example 3
Source File: MsgpackClient.java    From laser with Apache License 2.0 5 votes vote down vote up
public Object write(Object[] req, String method, Class<?> valueClass)
		throws Exception {
	Value vaule = write(req, method);
	if (null == vaule) {
		return null;
	}
	Converter converter = new org.msgpack.unpacker.Converter(vaule);
	Object ret = converter.read(valueClass);
	converter.close();
	return ret;
}