public static Dependencies fromThrift(ByteBuffer bytes) {
    long startTs = 0L;
    long endTs = 0L;
    List<DependencyLink> links = Collections.emptyList();

    ReadBuffer buffer = ReadBuffer.wrapUnsafe(bytes);
    while (true) {
      ThriftField thriftField = ThriftField.read(buffer);
      if (thriftField.type == TYPE_STOP) break;

      if (thriftField.isEqualTo(START_TS)) {
        startTs = buffer.readLong();
      } else if (thriftField.isEqualTo(END_TS)) {
        endTs = buffer.readLong();
      } else if (thriftField.isEqualTo(LINKS)) {
        int length = ThriftCodec.readListLength(buffer);
        if (length == 0) continue;
        links = new ArrayList<>(length);
        for (int i = 0; i < length; i++) {
          links.add(DependencyLinkAdapter.read(buffer));
        }
      } else {
        skip(buffer, thriftField.type);
      }
    }

    return Dependencies.create(startTs, endTs, links);
  }
Reads from buffer serialized in TBinaryProtocol
zipkin/src/main/java/zipkin2/internal/Dependencies.java