$ 0 0 java.io.InputStream inputStream = [open file and get input stream] java.io.InputStreamReader reader = new java.io.InputStreamReader(inputStream); MyProto.Builder myProtoBuilder = myProto.newBuilder(); TextFormat.merge(reader, myProtoBuilder);