public static byte[] serialize(List<? extends Object> data) {
		int type = -1;
		if (data == null || data.size() == 0
				|| (type = checkType(data)) < 0)
			return null;

		String str = JSONValue.toJSONString(data);

		try {
			byte[] bytes = str.getBytes(charset);
			int meta = encodeMeta(data.size(), type);
			ByteBuffer bb = ByteBuffer.allocate(4 + bytes.length);
			bb.putInt(meta);
			bb.put(bytes);

			return bb.array();
		} catch (UnsupportedEncodingException e) {
			return null;
		}
	}