Created
April 1, 2011 21:58
-
-
Save imownbey/898940 to your computer and use it in GitHub Desktop.
This file contains 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
def apply(iprot: TProtocol) = { | |
var field: TField = null | |
var message: String = null | |
var another: Int = 0 | |
while(true) { | |
field = iprot.readFieldBegin | |
if(field.`type` == TType.STOP) { | |
break | |
} | |
field.id match { | |
case 1 => { | |
field.`type` match { | |
case TType.STRING => message = iprot.readString | |
case _ => TProtocolUtil.skip(iprot, field.`type`) | |
} | |
break | |
} | |
case 2 => { | |
field.`type` match { | |
case TType.I32 => another = iprot.readI32() | |
case _ => TProtocolUtil.skip(iprot, field.`type`) | |
} | |
} | |
case _ => TProtocolUtil.skip(iprot, field.`type`) | |
} | |
iprot.readFieldEnd(); | |
} | |
iprot.readStructEnd(); | |
new Bonk(message, author) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment