use of org.smpp.util.ByteBuffer in project opensmpp by OpenSmpp.
the class TLVShort method getValueData.
protected ByteBuffer getValueData() throws ValueNotSetException {
ByteBuffer valueBuf = new ByteBuffer();
valueBuf.appendShort(getValue());
return valueBuf;
}
use of org.smpp.util.ByteBuffer in project opensmpp by OpenSmpp.
the class TLVString method getValueData.
public ByteBuffer getValueData() throws ValueNotSetException {
ByteBuffer valueBuf = new ByteBuffer();
valueBuf.appendCString(getValue());
return valueBuf;
}
use of org.smpp.util.ByteBuffer in project opensmpp by OpenSmpp.
the class ByteBufferTest method testAppendBufferWithEmptyDoesNothing.
@Test
public void testAppendBufferWithEmptyDoesNothing() {
buffer.appendBuffer(new ByteBuffer(new byte[] {}));
assertNull(buffer.getBuffer());
}
use of org.smpp.util.ByteBuffer in project opensmpp by OpenSmpp.
the class ByteBufferTest method testRemoveBufferRemovesFirst.
@Test
public void testRemoveBufferRemovesFirst() throws Exception {
buffer = bufferOf(A, B, C);
ByteBuffer b = buffer.removeBuffer(2);
assertArrayEquals(new byte[] { A, B }, b.getBuffer());
assertBufferMatches(C);
}
use of org.smpp.util.ByteBuffer in project opensmpp by OpenSmpp.
the class ByteBufferTest method testAppendStringWithZeroCount.
@Test
public void testAppendStringWithZeroCount() {
buffer = new ByteBuffer(new byte[] {});
buffer.appendString(ABC, 0);
assertBufferMatches(new byte[] {});
}
Aggregations