code: public static String getSerializedSchema(String gdatHeader) {
      /*Format :
         GDAT\nVERSION:4\nSCHEMALENGTH:123\n
         FTA {\n
           STREAM <name> {\n
             <list of fields>\n
           }\n
           <query text>\n
         }
       */
      int startBracketIndex = gdatHeader.indexOf("{");
      startBracketIndex = gdatHeader.indexOf("{", startBracketIndex + 1);
      int endBracketIndex = gdatHeader.indexOf("}");
      Preconditions.checkArgument(endBracketIndex > startBracketIndex);
      return gdatHeader.substring(startBracketIndex + 1, endBracketIndex);
    }
docs: Given a gdatHeader extract serialized Schema String.