protected int findOptionalParameter(short tag) { if (this.optionalParameters == null) { return -1; } int i = 0; for (Tlv tlv : this.optionalParameters) { if (tlv.getTag() == tag) { return i; } i++; } // if we get here, we didn't find the parameter by tag return -1; }
public void writeOptionalParameters(ChannelBuffer buffer, PduTranscoderContext context) throws UnrecoverablePduException, RecoverablePduException { if (this.optionalParameters == null) { return; } for (Tlv tlv : this.optionalParameters) { if (tlv.getTagName() == null) { tlv.setTagName(context.lookupTlvTagName(tlv.getTag())); } ChannelBufferUtil.writeTlv(buffer, tlv); } }
public void writeOptionalParameters(ChannelBuffer buffer, PduTranscoderContext context) throws UnrecoverablePduException, RecoverablePduException { if (this.optionalParameters == null) { return; } for (Tlv tlv : this.optionalParameters) { if (tlv.getTagName() == null) { tlv.setTagName(context.lookupTlvTagName(tlv.getTag())); } ChannelBufferUtil.writeTlv(buffer, tlv); } }
protected int findOptionalParameter(short tag) { if (this.optionalParameters == null) { return -1; } int i = 0; for (Tlv tlv : this.optionalParameters) { if (tlv.getTag() == tag) { return i; } i++; } // if we get here, we didn't find the parameter by tag return -1; }
public void writeOptionalParameters(ChannelBuffer buffer, PduTranscoderContext context) throws UnrecoverablePduException, RecoverablePduException { if (this.optionalParameters == null) { return; } for (Tlv tlv : this.optionalParameters) { if (tlv.getTagName() == null) { tlv.setTagName(context.lookupTlvTagName(tlv.getTag())); } ChannelBufferUtil.writeTlv(buffer, tlv); } }
protected int findOptionalParameter(short tag) { if (this.optionalParameters == null) { return -1; } int i = 0; for (Tlv tlv : this.optionalParameters) { if (tlv.getTag() == tag) { return i; } i++; } // if we get here, we didn't find the parameter by tag return -1; }
public void writeOptionalParameters(ChannelBuffer buffer, PduTranscoderContext context) throws UnrecoverablePduException, RecoverablePduException { if (this.optionalParameters == null) { return; } for (Tlv tlv : this.optionalParameters) { if (tlv.getTagName() == null) { tlv.setTagName(context.lookupTlvTagName(tlv.getTag())); } ChannelBufferUtil.writeTlv(buffer, tlv); } }
protected int findOptionalParameter(short tag) { if (this.optionalParameters == null) { return -1; } int i = 0; for (Tlv tlv : this.optionalParameters) { if (tlv.getTag() == tag) { return i; } i++; } // if we get here, we didn't find the parameter by tag return -1; }
public void readOptionalParameters(ChannelBuffer buffer, PduTranscoderContext context) throws UnrecoverablePduException, RecoverablePduException { // if there is any data left, it's part of an optional parameter while (buffer.readableBytes() > 0) { Tlv tlv = ChannelBufferUtil.readTlv(buffer); if (tlv.getTagName() == null) { tlv.setTagName(context.lookupTlvTagName(tlv.getTag())); } this.addOptionalParameter(tlv); } }
protected int findOptionalParameter(short tag) { if (this.optionalParameters == null) { return -1; } int i = 0; for (FastList.Node<Tlv> node = this.optionalParameters.head(), end = this.optionalParameters.tail(); (node = node .getNext()) != end;) { Tlv tlv = node.getValue(); if (tlv.getTag() == tag) { return i; } i++; } // if we get here, we didn't find the parameter by tag return -1; }
public void readOptionalParameters(ChannelBuffer buffer, PduTranscoderContext context) throws UnrecoverablePduException, RecoverablePduException { // if there is any data left, it's part of an optional parameter while (buffer.readableBytes() > 0) { Tlv tlv = ChannelBufferUtil.readTlv(buffer); if (tlv.getTagName() == null) { tlv.setTagName(context.lookupTlvTagName(tlv.getTag())); } this.addOptionalParameter(tlv); } }
protected int findOptionalParameter(short tag) { if (this.optionalParameters == null) { return -1; } int i = 0; for (FastList.Node<Tlv> node = this.optionalParameters.head(), end = this.optionalParameters.tail(); (node = node .getNext()) != end;) { Tlv tlv = node.getValue(); if (tlv.getTag() == tag) { return i; } i++; } // if we get here, we didn't find the parameter by tag return -1; }
public void readOptionalParameters(ChannelBuffer buffer, PduTranscoderContext context) throws UnrecoverablePduException, RecoverablePduException { // if there is any data left, it's part of an optional parameter while (buffer.readableBytes() > 0) { Tlv tlv = ChannelBufferUtil.readTlv(buffer); if (tlv.getTagName() == null) { tlv.setTagName(context.lookupTlvTagName(tlv.getTag())); } this.addOptionalParameter(tlv); } }
static public void writeTlv(ChannelBuffer buffer, Tlv tlv) throws NotEnoughDataInBufferException { // a null is a noop if (tlv == null) { return; } buffer.writeShort(tlv.getTag()); buffer.writeShort(tlv.getLength()); if (tlv.getValue() != null) { buffer.writeBytes(tlv.getValue()); } }
public void readOptionalParameters(ChannelBuffer buffer, PduTranscoderContext context) throws UnrecoverablePduException, RecoverablePduException { // if there is any data left, it's part of an optional parameter while (buffer.readableBytes() > 0) { Tlv tlv = ChannelBufferUtil.readTlv(buffer); if (tlv.getTagName() == null) { tlv.setTagName(context.lookupTlvTagName(tlv.getTag())); } this.addOptionalParameter(tlv); } }
static public void writeTlv(ChannelBuffer buffer, Tlv tlv) throws NotEnoughDataInBufferException { // a null is a noop if (tlv == null) { return; } buffer.writeShort(tlv.getTag()); buffer.writeShort(tlv.getLength()); if (tlv.getValue() != null) { buffer.writeBytes(tlv.getValue()); } }
static public void writeTlv(ChannelBuffer buffer, Tlv tlv) throws NotEnoughDataInBufferException { // a null is a noop if (tlv == null) { return; } buffer.writeShort(tlv.getTag()); buffer.writeShort(tlv.getLength()); if (tlv.getValue() != null) { buffer.writeBytes(tlv.getValue()); } }
static public void writeTlv(ChannelBuffer buffer, Tlv tlv) throws NotEnoughDataInBufferException { // a null is a noop if (tlv == null) { return; } buffer.writeShort(tlv.getTag()); buffer.writeShort(tlv.getLength()); if (tlv.getValue() != null) { buffer.writeBytes(tlv.getValue()); } }
@Override public void write(TlvSet tlvSet, javolution.xml.XMLFormat.OutputElement xml) throws XMLStreamException { if (tlvSet.optionalParameters != null && tlvSet.optionalParameters.size() > 0) { for (int i1 = 0; i1 < tlvSet.optionalParameters.size(); i1++) { Tlv tlv = tlvSet.optionalParameters.get(i1); TlvProxy tlvProxy = new TlvProxy(); tlvProxy.tag = tlv.getTag(); tlvProxy.value = tlv.getValue(); xml.add(tlvProxy, TLV, TlvProxy.class); } } } };
@Override public void write(TlvSet tlvSet, javolution.xml.XMLFormat.OutputElement xml) throws XMLStreamException { if (tlvSet.optionalParameters != null && tlvSet.optionalParameters.size() > 0) { for (int i1 = 0; i1 < tlvSet.optionalParameters.size(); i1++) { Tlv tlv = tlvSet.optionalParameters.get(i1); TlvProxy tlvProxy = new TlvProxy(); tlvProxy.tag = tlv.getTag(); tlvProxy.value = tlv.getValue(); xml.add(tlvProxy, TLV, TlvProxy.class); } } } };