static NcStreamProto.Attribute.Builder encodeAtt(Attribute att) { NcStreamProto.Attribute.Builder attBuilder = NcStreamProto.Attribute.newBuilder(); attBuilder.setName(att.getShortName()); attBuilder.setType(encodeAttributeType(att.getDataType())); attBuilder.setLen(att.getLength()); // values if (att.getLength() > 0) { if (att.isString()) { for (int i = 0; i < att.getLength(); i++) attBuilder.addSdata(att.getStringValue(i)); } else { Array data = att.getValues(); ByteBuffer bb = data.getDataAsByteBuffer(); attBuilder.setData(ByteString.copyFrom(bb.array())); } } return attBuilder; }
static NcStreamProto.Attribute.Builder encodeAtt(Attribute att) { NcStreamProto.Attribute.Builder attBuilder = NcStreamProto.Attribute.newBuilder(); attBuilder.setName(att.getShortName()); attBuilder.setType(encodeAttributeType(att.getDataType())); attBuilder.setLen(att.getLength()); // values if (att.getLength() > 0) { if (att.isString()) { for (int i = 0; i < att.getLength(); i++) attBuilder.addSdata(att.getStringValue(i)); } else { Array data = att.getValues(); ByteBuffer bb = data.getDataAsByteBuffer(); attBuilder.setData(ByteString.copyFrom(bb.array())); } } return attBuilder; }
static public NcStreamProto.Attribute.Builder encodeAtt(Attribute att) { NcStreamProto.Attribute.Builder attBuilder = NcStreamProto.Attribute.newBuilder(); attBuilder.setName(att.getShortName()); attBuilder.setDataType(convertDataType(att.getDataType())); attBuilder.setLen(att.getLength()); // values if (att.getLength() > 0) { if (att.isString()) { for (int i = 0; i < att.getLength(); i++) attBuilder.addSdata(att.getStringValue(i)); } else { Array data = att.getValues(); ByteBuffer bb = data.getDataAsByteBuffer(); attBuilder.setData(ByteString.copyFrom(bb.array())); } } return attBuilder; }
public Builder toBuilder() { return newBuilder(this); }
public Builder toBuilder() { return newBuilder(this); }
public Builder newBuilderForType() { return newBuilder(); } public static Builder newBuilder() {
public Builder newBuilderForType() { return newBuilder(); } public static Builder newBuilder(ucar.nc2.stream.NcStreamProto.Attribute prototype) {
public static Builder newBuilder(ucar.nc2.stream.NcStreamProto.Attribute prototype) { return newBuilder().mergeFrom(prototype); } public Builder toBuilder() { return newBuilder(this); }
public static Builder newBuilder(ucar.nc2.stream.NcStreamProto.Attribute prototype) { return newBuilder().mergeFrom(prototype); } public Builder toBuilder() { return newBuilder(this); }
public Builder newBuilderForType() { return newBuilder(); } public static Builder newBuilder(ucar.nc2.stream.NcStreamProto.Attribute prototype) {