private NetcdfFile proto2nc(NcStreamProto.Header proto, NetcdfFile ncfile) throws InvalidProtocolBufferException { if (ncfile == null) ncfile = new NetcdfFileSubclass(); // not used i think ncfile.setLocation(proto.getLocation()); if (proto.getId().length() > 0) ncfile.setId(proto.getId()); if (proto.getTitle().length() > 0) ncfile.setTitle(proto.getTitle()); NcStreamProto.Group root = proto.getRoot(); NcStream.readGroup(root, ncfile, ncfile.getRootGroup()); ncfile.finish(); return ncfile; }
public NetcdfFile proto2nc(NcStreamProto.Header proto, NetcdfFile ncfile) throws InvalidProtocolBufferException { if (ncfile == null) ncfile = new NetcdfFileSubclass(); // not used i think ncfile.setLocation(proto.getLocation()); if (proto.hasId()) ncfile.setId(proto.getId()); if (proto.hasTitle()) ncfile.setTitle(proto.getTitle()); NcStreamProto.Group root = proto.getRoot(); NcStream.readGroup(root, ncfile, ncfile.getRootGroup()); ncfile.finish(); return ncfile; }
public NetcdfFile proto2nc(NcStreamProto.Header proto, NetcdfFile ncfile) throws InvalidProtocolBufferException { if (ncfile == null) ncfile = new NetcdfFileStream(); // not used i think ncfile.setLocation(proto.getLocation()); if (proto.hasId()) ncfile.setId(proto.getId()); if (proto.hasTitle()) ncfile.setTitle(proto.getTitle()); NcStreamProto.Group root = proto.getRoot(); NcStream.readGroup(root, ncfile, ncfile.getRootGroup()); ncfile.finish(); return ncfile; }
NcStream.readGroup(root, ncfile, ncfile.getRootGroup()); ncfile.finish();
NcStream.readGroup(root, ncfile, ncfile.getRootGroup()); ncfile.finish();
NcStream.readGroup(root, ncfile, ncfile.getRootGroup()); ncfile.finish();
static void readGroup(NcStreamProto.Group proto, NetcdfFile ncfile, Group g) throws InvalidProtocolBufferException { for (NcStreamProto.Dimension dim : proto.getDimsList()) g.addDimension(NcStream.decodeDim(dim)); for (NcStreamProto.Attribute att : proto.getAttsList()) g.addAttribute(NcStream.decodeAtt(att)); for (NcStreamProto.EnumTypedef enumType : proto.getEnumTypesList()) g.addEnumeration(NcStream.decodeEnumTypedef(enumType)); for (NcStreamProto.Variable var : proto.getVarsList()) g.addVariable(NcStream.decodeVar(ncfile, g, null, var)); for (NcStreamProto.Structure s : proto.getStructsList()) g.addVariable(NcStream.decodeStructure(ncfile, g, null, s)); for (NcStreamProto.Group gp : proto.getGroupsList()) { Group ng = new Group(ncfile, g, gp.getName()); g.addGroup(ng); readGroup(gp, ncfile, ng); } }
static void readGroup(NcStreamProto.Group proto, NetcdfFile ncfile, Group g) throws InvalidProtocolBufferException { for (NcStreamProto.Dimension dim : proto.getDimsList()) g.addDimension(NcStream.decodeDim(dim)); for (NcStreamProto.Attribute att : proto.getAttsList()) g.addAttribute(NcStream.decodeAtt(att)); for (NcStreamProto.EnumTypedef enumType : proto.getEnumTypesList()) g.addEnumeration(NcStream.decodeEnumTypedef(enumType)); for (NcStreamProto.Variable var : proto.getVarsList()) g.addVariable(NcStream.decodeVar(ncfile, g, null, var)); for (NcStreamProto.Structure s : proto.getStructsList()) g.addVariable(NcStream.decodeStructure(ncfile, g, null, s)); for (NcStreamProto.Group gp : proto.getGroupsList()) { Group ng = new Group(ncfile, g, gp.getName()); g.addGroup(ng); readGroup(gp, ncfile, ng); } }
static void readGroup(NcStreamProto.Group proto, NetcdfFile ncfile, Group g) throws InvalidProtocolBufferException { for (NcStreamProto.Dimension dim : proto.getDimsList()) g.addDimension(NcStream.decodeDim(dim)); for (NcStreamProto.Attribute att : proto.getAttsList()) g.addAttribute(NcStream.decodeAtt(att)); for (NcStreamProto.EnumTypedef enumType : proto.getEnumTypesList()) g.addEnumeration(NcStream.decodeEnumTypedef(enumType)); for (NcStreamProto.Variable var : proto.getVarsList()) g.addVariable(NcStream.decodeVar(ncfile, g, null, var)); for (NcStreamProto.Structure s : proto.getStructsList()) g.addVariable(NcStream.decodeStructure(ncfile, g, null, s)); for (NcStreamProto.Group gp : proto.getGroupsList()) { Group ng = new Group(ncfile, g, gp.getName()); g.addGroup(ng); readGroup(gp, ncfile, ng); } }