| // Copyright (c) 2006- Facebook |
| // Distributed under the Thrift Software License |
| // See accompanying file LICENSE or visit the Thrift site at: |
| // http://developers.facebook.com/thrift/ |
| package com.facebook.thrift.protocol; |
| import com.facebook.thrift.TException; |
| import com.facebook.thrift.transport.TTransport; |
| * Utility class with static methods for interacting with protocol data |
| * @author Mark Slee <mcslee@facebook.com> |
| public class TProtocolUtil { |
| public static void skip(TProtocol prot, byte type) |
| TField field = prot.readFieldBegin(); |
| if (field.type == TType.STOP) { |
| TMap map = prot.readMapBegin(); |
| for (int i = 0; i < map.size; i++) { |
| skip(prot, map.valueType); |
| TSet set = prot.readSetBegin(); |
| for (int i = 0; i < set.size; i++) { |
| skip(prot, set.elemType); |
| TList list = prot.readListBegin(); |
| for (int i = 0; i < list.size; i++) { |
| skip(prot, list.elemType); |