You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Thanks for your attention.
FastProto is undergoing a major version change, version 4.0 will ensure simple api, clearer data types, and higher efficiency.
import org.indunet.fastproto.FastProto;
import org.indunet.fastproto.annotation.type.IntegerType;
import java.nio.ByteBuffer;
import java.util.Arrays;
public class FastProtoTest {
@IntegerType(0)
private int nameLen = 5;
public static void main(String[] args) {
// Output results: [5, 0, 0, 0]
System.out.println(Arrays.toString(FastProto.toByteArray(new FastProtoTest())));
// toByteArray and parseFrom is right.
System.out.println(
FastProto.parseFrom(FastProto.toByteArray(new FastProtoTest()), FastProtoTest.class)
.nameLen);
// Output results: [0, 0, 0, 5]
System.out.println(Arrays.toString(ByteBuffer.allocate(4).putInt(5).array()));
}
}
The text was updated successfully, but these errors were encountered: