// struct.
Buffer buf = new Buffer();
OutputStream oStream = new OutputStream(buf);
oStream.write_string(nestedMember1Value);
oStream.write_boolean(nestedMember2Value.booleanValue());
oStream.write_fixed(fixedValue.movePointRight(2));
oStream.write_long(enumIndex);
oStream.write_float(floatValue.floatValue());
InputStream iStream = oStream.create_input_stream();