public static ProtoFile parse(String name, Reader reader) throws IOException {
    CharArrayWriter writer = new CharArrayWriter();
    char[] buffer = new char[1024];
    int count;
    while ((count = reader.read(buffer)) != -1) {
      writer.write(buffer, 0, count);
    }
    return new ProtoParser(name, writer.toCharArray()).readProtoFile();
  }
public static ProtoFile parse ( String name , Reader reader ) throws IOException { CharArrayWriter writer = new CharArrayWriter ( ) ; char [ ] buffer = new char [ 1024 ] ; int count ; while ( ( count = reader . read ( buffer ) ) != - 1 ) { writer . write ( buffer , 0 , count ) ; } return new ProtoParser ( name , writer . toCharArray ( ) ) . readProtoFile ( ) ; }
Parse a named {@code .proto} schema. The {@code Reader} is not closed.