8 #ifndef INCLUDE_INFINISPAN_HOTROD_JBOSSMARSHALLER_H_ 9 #define INCLUDE_INFINISPAN_HOTROD_JBOSSMARSHALLER_H_ 18 template<
typename R>
static R
unmarshall(
const std::vector<char>& b);
19 template<
typename A>
static std::vector<char>
marshall(A a);
23 b.resize(s.size() + 3);
26 buf[0] = JBasicMarshallerHelper::MARSHALL_VERSION;
27 buf[1] = JBasicMarshallerHelper::SMALL_STRING;
28 buf[2] = (char) s.size();
29 memcpy(buf + 3, s.data(), s.size());
32 b.resize(s.size() + 4);
35 buf[0] = JBasicMarshallerHelper::MARSHALL_VERSION;
36 buf[1] = JBasicMarshallerHelper::MEDIUM_STRING;
37 buf[2] = (char) (s.size() >> 8);
38 buf[3] = s.size() & 0xff;
40 memcpy(buf + 4, s.data(), s.size());
47 for (
int i = 0; i < 4; i++) {
49 result ^= (int) *(b.data() + i + 2) & 0xFF;
51 int* s =
new int(result);
57 std::string* s =
new std::string(b.begin() + 3, b.end() - 3);
63 if (s.size() <= 0x100) {
73 std::vector<char> res;
75 buf[0] = JBasicMarshallerHelper::MARSHALL_VERSION;
76 buf[1] = JBasicMarshallerHelper::INTEGER;
77 for (
int i = 0; i < 4; i++) {
78 buf[5 - i] = (char) ((a) >> (8 * i));
80 res.assign(buf, buf + 6);
static std::vector< char > marshall(A a)
Definition: JBossMarshaller.h:16
static void marshallMedium(const std::string &s, std::vector< char > &b)
Definition: JBossMarshaller.h:31
Definition: AuthenticationConfiguration.h:10
virtual ~JBossMarshaller()=0
static void marshallSmall(const std::string &s, std::vector< char > &b)
Definition: JBossMarshaller.h:22
static R unmarshall(const std::vector< char > &b)