PUBLIC OBJECT

Wire Protocol Buffers

At Square we like protocol buffers because the schemas make it easy to share data between client server teams. But the Java code that protoc generates is both heavyweight and ugly.

So we created Wire, a new protocol buffer library for Android and Java. To get a feel for Wire, just compare its generated source vs. protoc's.

person.proto, the input schema
3 types, 9 members, 44 lines of code
https://gist.github.com/swankjesse/6323835

protoc's generated PersonProtos.java
8 types, ~230 members, 2145 lines of code
https://gist.github.com/swankjesse/6323811

Wire's generated Person.java
5 types, 21 members, 208 lines of code
https://gist.github.com/swankjesse/6323830

If you're using protocol buffers, you should take a look at Wire.

Introducing Wire Protocol Buffers