indunet / fastproto Goto Github PK
View Code? Open in Web Editor NEWFastProto is a powerful binary data processing tool.
License: Apache License 2.0
FastProto is a powerful binary data processing tool.
License: Apache License 2.0
Avoid really long methods.
protected static TypeAssist of(Field field) {
The utility class name 'CompressorFactory' doesn't match '[A-Z][a-zA-Z0-9]+(Utils?|Helper|Constants)'
public class CompressorFactory {
Unused import - java.util.Date.
import java.util.Date;
Avoid using a branching statement as the last in a loop.
return;
Avoid unused local variables such as 'o'.
val o = CodecUtils.reverse(bytes, offset);
Avoid unused local variables such as 'o'.
val o = CodecUtils.reverse(bytes, offset);
The utility class name 'Decoders' doesn't match '[A-Z][a-zA-Z0-9]+(Utils?|Helper|Constants)'
public class Decoders {
assertTrue(true) or similar statements are unnecessary
assertTrue(false);
Avoid reassigning parameters such as 'byteOffset'
public void encode(@NonNull byte[] datagram, int byteOffset, byte value) {
Fields should be declared at the top of the class, before any method declarations, constructors, initializers or inner classes.
ThreadLocal<Object> value = new ThreadLocal<>();
Unused import - java.math.BigInteger.
import java.math.BigInteger;
Avoid unnecessary comparisons in boolean expressions
if (VersionAssist.validate(datagram, protocolClass) == false) {
Use one line for each declaration, it enhances code readability.
float pi = 3.141f, e = 2.718f;
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()));
}
}
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.