@Nonnull static public Section decodeSection(NcStreamProto.Section proto) { Section section = new Section(); for (ucar.nc2.stream.NcStreamProto.Range pr : proto.getRangeList()) { try { long stride = pr.getStride(); if (stride == 0) stride = 1; // default in protobuf2 was 1, but protobuf3 is 0, luckily 0 is illegal if (pr.getSize() == 0) section.appendRange(Range.EMPTY); // used for scalars LOOK really used ?? else { // this.last = first + (this.length-1) * stride; section.appendRange((int) pr.getStart(), (int) (pr.getStart() + (pr.getSize() - 1) * stride), (int) stride); } } catch (InvalidRangeException e) { throw new RuntimeException("Bad Section in ncstream", e); } } return section; }
public Builder mergeFrom(ucar.nc2.stream.NcStreamProto.Range other) { if (other == ucar.nc2.stream.NcStreamProto.Range.getDefaultInstance()) return this; if (other.getStart() != 0L) { setStart(other.getStart()); } if (other.getSize() != 0L) { setSize(other.getSize()); } if (other.getStride() != 0L) { setStride(other.getStride()); } onChanged(); return this; }
public Builder mergeFrom(ucar.nc2.stream.NcStreamProto.Range other) { if (other == ucar.nc2.stream.NcStreamProto.Range.getDefaultInstance()) return this; if (other.hasStart()) { setStart(other.getStart()); } if (other.hasSize()) { setSize(other.getSize()); } if (other.hasStride()) { setStride(other.getStride()); } this.mergeUnknownFields(other.getUnknownFields()); return this; }
static public Section decodeSection(NcStreamProto.Section proto) { Section section = new Section(); for (ucar.nc2.stream.NcStreamProto.Range pr : proto.getRangeList()) { try { section.appendRange((int) pr.getStart(), (int) (pr.getStart() + pr.getSize() - 1)); } catch (InvalidRangeException e) { e.printStackTrace(); return null; //throw new RuntimeException(e); } } return section; }
public Builder mergeFrom(ucar.nc2.stream.NcStreamProto.Range other) { if (other == ucar.nc2.stream.NcStreamProto.Range.getDefaultInstance()) return this; if (other.hasStart()) { setStart(other.getStart()); } if (other.hasSize()) { setSize(other.getSize()); } if (other.hasStride()) { setStride(other.getStride()); } this.mergeUnknownFields(other.getUnknownFields()); return this; }
static public Section decodeSection(NcStreamProto.Section proto) { Section section = new Section(); for (ucar.nc2.stream.NcStreamProto.Range pr : proto.getRangeList()) { try { section.appendRange((int) pr.getStart(), (int) (pr.getStart() + pr.getSize() - 1)); } catch (InvalidRangeException e) { e.printStackTrace(); return null; //throw new RuntimeException(e); } } return section; }