Created
August 2, 2016 11:23
-
-
Save tetek/11fe15935d5269bf72103c5a85f4f2d9 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| jspb.BinaryWriter.prototype.writeString=function(a,b){ | |
| if(null!=b){ | |
| this.rawWriteFieldHeader_(a,jspb.BinaryConstants.WireType.DELIMITED); | |
| for(var c=[],d=0; d < b.length; d++) { | |
| var e = b.charCodeAt(d); | |
| if (e < 128) { | |
| c.push(e) | |
| } | |
| else if (e < 2048){ | |
| c.push(e>>6|192) | |
| c.push(e&63|128) | |
| } | |
| else if (e < 65536) { | |
| c.push(e>>12|224) | |
| c.push(e>>6&63|128) | |
| c.push(e&63|128) | |
| } | |
| else { | |
| c.push(e>>18|240) | |
| c.push((e>>12)&63|224) | |
| c.push(e>>6&63|128) | |
| c.push(e&63|128) | |
| } | |
| } | |
| this.rawWriteUnsignedVarint32(c.length);this.appendArray_(c) | |
| } | |
| }; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment