Package org.smpp.util

Examples of org.smpp.util.ByteBuffer


   *            this exception can be thrown
   * @see #getValueData()
   */
  public int getLength() throws ValueNotSetException {
    if (hasValue()) {
      ByteBuffer valueBuf = getValueData();
      if (valueBuf != null) {
        return valueBuf.length();
      } else {
        return 0;
      }
    } else {
      return 0;
View Full Code Here


   * data value calls abstract <code>setValueData</code>.
   */
  public void setData(ByteBuffer buffer) throws NotEnoughDataInByteBufferException, TLVException {
    short newTag = buffer.removeShort();
    int length = buffer.removeShort();
    ByteBuffer valueBuf = buffer.removeBuffer(length);
    setValueData(valueBuf);
    setTag(newTag);
  }
View Full Code Here

   * Returns the binary TLV created from tag, length and binary data value
   * carried by this TLV.
   */
  public ByteBuffer getData() throws ValueNotSetException {
    if (hasValue()) {
      ByteBuffer tlvBuf = new ByteBuffer();
      tlvBuf.appendShort(getTag());
      tlvBuf.appendShort(encodeUnsigned(getLength()));
      tlvBuf.appendBuffer(getValueData());
      return tlvBuf;
    } else {
      return null;
    }
  }
View Full Code Here

TOP

Related Classes of org.smpp.util.ByteBuffer

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.