public ucar.nc2.stream.NcStreamProto.Attribute buildPartial() { ucar.nc2.stream.NcStreamProto.Attribute result = new ucar.nc2.stream.NcStreamProto.Attribute(this); int from_bitField0_ = bitField0_; int to_bitField0_ = 0; result.name_ = name_; result.type_ = type_; result.len_ = len_; result.data_ = data_; if (((bitField0_ & 0x00000010) == 0x00000010)) { sdata_ = sdata_.getUnmodifiableView(); bitField0_ = (bitField0_ & ~0x00000010); } result.sdata_ = sdata_; result.unsigned_ = unsigned_; result.dataType_ = dataType_; result.bitField0_ = to_bitField0_; onBuilt(); return result; }
/** * <code>repeated .Attribute atts = 3;</code> * * <pre> * find calendar attribute here? * </pre> */ public ucar.nc2.stream.NcStreamProto.Attribute.Builder addAttsBuilder( int index) { return getAttsFieldBuilder().addBuilder( index, ucar.nc2.stream.NcStreamProto.Attribute.getDefaultInstance()); } /**
public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { return ucar.nc2.stream.NcStreamProto.Attribute.getDescriptor().getEnumTypes().get(0); }
if (((bitField0_ & 0x00000001) == 0x00000001)) { size += com.google.protobuf.CodedOutputStream .computeBytesSize(1, getNameBytes()); size += 1 * getSdataList().size(); .computeBoolSize(6, unsigned_); size += getUnknownFields().getSerializedSize(); memoizedSerializedSize = size; return size;
if (!getNameBytes().isEmpty()) { size += com.google.protobuf.GeneratedMessage.computeStringSize(1, name_); dataSize += computeStringSizeNoTag(sdata_.getRaw(i)); size += 1 * getSdataList().size();
if (((bitField0_ & 0x00000001) == 0x00000001)) { size += com.google.protobuf.CodedOutputStream .computeBytesSize(1, getNameBytes()); size += 1 * getSdataList().size(); .computeBoolSize(6, unsigned_); size += getUnknownFields().getSerializedSize(); memoizedSerializedSize = size; return size;
public ucar.nc2.stream.NcStreamProto.Attribute buildPartial() { ucar.nc2.stream.NcStreamProto.Attribute result = new ucar.nc2.stream.NcStreamProto.Attribute(this); int from_bitField0_ = bitField0_; int to_bitField0_ = 0;
public ucar.nc2.stream.NcStreamProto.Attribute buildPartial() { ucar.nc2.stream.NcStreamProto.Attribute result = new ucar.nc2.stream.NcStreamProto.Attribute(this); int from_bitField0_ = bitField0_; int to_bitField0_ = 0;
public Builder mergeFrom(ucar.nc2.stream.NcStreamProto.Attribute other) { if (other == ucar.nc2.stream.NcStreamProto.Attribute.getDefaultInstance()) return this; if (other.hasName()) { bitField0_ |= 0x00000001; name_ = other.name_; onChanged(); if (other.hasType()) { setType(other.getType()); if (other.hasLen()) { setLen(other.getLen()); if (other.hasData()) { setData(other.getData()); if (other.hasUnsigned()) { setUnsigned(other.getUnsigned()); this.mergeUnknownFields(other.getUnknownFields()); return this;
public Builder mergeFrom(ucar.nc2.stream.NcStreamProto.Attribute other) { if (other == ucar.nc2.stream.NcStreamProto.Attribute.getDefaultInstance()) return this; if (!other.getName().isEmpty()) { name_ = other.name_; onChanged(); setTypeValue(other.getTypeValue()); if (other.getLen() != 0) { setLen(other.getLen()); if (other.getData() != com.google.protobuf.ByteString.EMPTY) { setData(other.getData()); if (other.getUnsigned() != false) { setUnsigned(other.getUnsigned()); setDataTypeValue(other.getDataTypeValue());
public Builder mergeFrom(ucar.nc2.stream.NcStreamProto.Attribute other) { if (other == ucar.nc2.stream.NcStreamProto.Attribute.getDefaultInstance()) return this; if (other.hasName()) { bitField0_ |= 0x00000001; name_ = other.name_; onChanged(); if (other.hasType()) { setType(other.getType()); if (other.hasLen()) { setLen(other.getLen()); if (other.hasData()) { setData(other.getData()); if (other.hasUnsigned()) { setUnsigned(other.getUnsigned()); this.mergeUnknownFields(other.getUnknownFields()); return this;
static public Attribute decodeAtt(NcStreamProto.Attribute attp) { // BARF LOOK DataType dtOld = decodeAttributeType(attp.getType()); DataType dtNew = convertDataType(attp.getDataType()); DataType dtUse; if (dtNew != DataType.CHAR) dtUse = dtNew; else if (dtOld != DataType.STRING) dtUse = dtOld; else if (attp.getSdataCount() > 0) dtUse = DataType.STRING; else dtUse = DataType.CHAR; int len = attp.getLen(); if (len == 0) // deal with empty attribute return new Attribute(attp.getName(), dtUse); if (dtUse == DataType.STRING) { int lenp = attp.getSdataCount(); if (lenp != len) System.out.println("HEY lenp != len"); if (lenp == 1) return new Attribute(attp.getName(), attp.getSdata(0)); else { Array data = Array.factory(dtUse, new int[]{lenp}); for (int i = 0; i < lenp; i++) data.setObject(i, attp.getSdata(i)); return new Attribute(attp.getName(), data); } } else { ByteString bs = attp.getData(); ByteBuffer bb = ByteBuffer.wrap(bs.toByteArray()); return new Attribute(attp.getName(), Array.factory(dtUse, (int[]) null, bb)); // if null, then use int[]{bb // .limit()} } }
public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { if (!getNameBytes().isEmpty()) { com.google.protobuf.GeneratedMessage.writeString(output, 1, name_); } if (type_ != ucar.nc2.stream.NcStreamProto.Attribute.Type.STRING.getNumber()) { output.writeEnum(2, type_); } if (len_ != 0) { output.writeUInt32(3, len_); } if (!data_.isEmpty()) { output.writeBytes(4, data_); } for (int i = 0; i < sdata_.size(); i++) { com.google.protobuf.GeneratedMessage.writeString(output, 5, sdata_.getRaw(i)); } if (unsigned_ != false) { output.writeBool(6, unsigned_); } if (dataType_ != ucar.nc2.stream.NcStreamProto.DataType.CHAR.getNumber()) { output.writeEnum(7, dataType_); } }
public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { getSerializedSize(); if (((bitField0_ & 0x00000001) == 0x00000001)) { output.writeBytes(1, getNameBytes()); } if (((bitField0_ & 0x00000002) == 0x00000002)) { output.writeEnum(2, type_.getNumber()); } if (((bitField0_ & 0x00000004) == 0x00000004)) { output.writeUInt32(3, len_); } if (((bitField0_ & 0x00000008) == 0x00000008)) { output.writeBytes(4, data_); } for (int i = 0; i < sdata_.size(); i++) { output.writeBytes(5, sdata_.getByteString(i)); } if (((bitField0_ & 0x00000010) == 0x00000010)) { output.writeBool(6, unsigned_); } getUnknownFields().writeTo(output); }
public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { getSerializedSize(); if (((bitField0_ & 0x00000001) == 0x00000001)) { output.writeBytes(1, getNameBytes()); } if (((bitField0_ & 0x00000002) == 0x00000002)) { output.writeEnum(2, type_.getNumber()); } if (((bitField0_ & 0x00000004) == 0x00000004)) { output.writeUInt32(3, len_); } if (((bitField0_ & 0x00000008) == 0x00000008)) { output.writeBytes(4, data_); } for (int i = 0; i < sdata_.size(); i++) { output.writeBytes(5, sdata_.getByteString(i)); } if (((bitField0_ & 0x00000010) == 0x00000010)) { output.writeBool(6, unsigned_); } getUnknownFields().writeTo(output); }
static Attribute decodeAtt(NcStreamProto.Attribute attp) { int len = attp.getLen(); if (len == 0) // deal with empty attribute return new Attribute(attp.getName(), decodeAttributeType(attp.getType()), false); // LOOK unsigned DataType dt = decodeAttributeType(attp.getType()); if (dt == DataType.STRING) { int lenp = attp.getSdataCount(); if (lenp != len) System.out.println("HEY lenp != len"); if (lenp == 1) return new Attribute(attp.getName(), attp.getSdata(0)); else { Array data = Array.factory(dt, new int[]{lenp}); for (int i = 0; i < lenp; i++) data.setObject(i, attp.getSdata(i)); return new Attribute(attp.getName(), data); } } else { ByteString bs = attp.getData(); ByteBuffer bb = ByteBuffer.wrap(bs.toByteArray()); return new Attribute(attp.getName(), Array.factory(decodeAttributeType(attp.getType()), null, bb)); } }
static Attribute decodeAtt(NcStreamProto.Attribute attp) { int len = attp.getLen(); if (len == 0) // deal with empty attribute return new Attribute(attp.getName(), decodeAttributeType(attp.getType())); DataType dt = decodeAttributeType(attp.getType()); if (dt == DataType.STRING) { int lenp = attp.getSdataCount(); if (lenp != len) System.out.println("HEY lenp != len"); if (lenp == 1) return new Attribute(attp.getName(), attp.getSdata(0)); else { Array data = Array.factory(dt, new int[]{lenp}); for (int i = 0; i < lenp; i++) data.setObject(i, attp.getSdata(i)); return new Attribute(attp.getName(), data); } } else { ByteString bs = attp.getData(); ByteBuffer bb = ByteBuffer.wrap(bs.toByteArray()); return new Attribute(attp.getName(), Array.factory(decodeAttributeType(attp.getType()), null, bb)); } }
public ucar.nc2.stream.NcStreamProto.Attribute getDefaultInstanceForType() { return ucar.nc2.stream.NcStreamProto.Attribute.getDefaultInstance(); }
public ucar.nc2.stream.NcStreamProto.Attribute getDefaultInstanceForType() { return ucar.nc2.stream.NcStreamProto.Attribute.getDefaultInstance(); }
public ucar.nc2.stream.NcStreamProto.Attribute getDefaultInstanceForType() { return ucar.nc2.stream.NcStreamProto.Attribute.getDefaultInstance(); }