(TBase t)
| 692 | } |
| 693 | |
| 694 | public static byte[] thriftSerialize(TBase t) { |
| 695 | try { |
| 696 | TSerializer ser = threadSer.get(); |
| 697 | if (ser == null) { |
| 698 | ser = new TSerializer(); |
| 699 | threadSer.set(ser); |
| 700 | } |
| 701 | return ser.serialize(t); |
| 702 | } catch (TException e) { |
| 703 | LOG.error("Failed to serialize to thrift: ", e); |
| 704 | throw new RuntimeException(e); |
| 705 | } |
| 706 | } |
| 707 | |
| 708 | public static <T> T thriftDeserialize(Class<T> c, byte[] b) { |
| 709 | try { |