@Test public void testRemoveStringZeroLength() throws Exception { assertEquals("", buffer.removeString(0, ASCII)); }
public String removeString(int size, String encoding) throws NotEnoughDataInByteBufferException, UnsupportedEncodingException { int len = length(); if (len < size) { throw new NotEnoughDataInByteBufferException(len, size); } UnsupportedEncodingException encodingException = null; String result = null; if (len > 0) { try { if (encoding != null) { result = new String(buffer, 0, size, encoding); } else { result = new String(buffer, 0, size); } } catch (UnsupportedEncodingException e) { debug.write("Unsupported encoding exception " + e); event.write(e, null); encodingException = e; } removeBytes0(size); } else { result = new String(""); } if (encodingException != null) { throw encodingException; } return result; }
ByteBuffer extends SmppObject { public String removeString(int size, String encoding) throws NotEnoughDataInByteBufferException, UnsupportedEncodingException { int len = length(); if (len < size) { throw new NotEnoughDataInByteBufferException(len, size); } UnsupportedEncodingException encodingException = null; String result = null; if (len > 0) { try { if (encoding != null) { result = new String(buffer, 0, size, encoding); } else { result = new String(buffer, 0, size); } } catch (UnsupportedEncodingException e) { debug.write("Unsupported encoding exception " + e); event.write(e, null); encodingException = e; } removeBytes0(size); } else { result = new String(""); } if (encodingException != null) { throw encodingException; } return result; } }
ByteBuffer extends SmppObject { public String removeString(int size, String encoding) throws NotEnoughDataInByteBufferException, UnsupportedEncodingException { int len = length(); if (len < size) { throw new NotEnoughDataInByteBufferException(len, size); } UnsupportedEncodingException encodingException = null; String result = null; if (len > 0) { try { if (encoding != null) { result = new String(buffer, 0, size, encoding); } else { result = new String(buffer, 0, size); } } catch (UnsupportedEncodingException e) { debug.write("Unsupported encoding exception " + e); event.write(e, null); encodingException = e; } removeBytes0(size); } else { result = new String(""); } if (encodingException != null) { throw encodingException; } return result; } ByteBuffer();  ByteBuffer(byte[] buffer); }
ByteBuffer extends SmppObject { public String removeString(int size, String encoding) throws NotEnoughDataInByteBufferException, UnsupportedEncodingException { int len = length(); if (len < size) { throw new NotEnoughDataInByteBufferException(len, size); } UnsupportedEncodingException encodingException = null; String result = null; if (len > 0) { try { if (encoding != null) { result = new String(buffer, 0, size, encoding); } else { result = new String(buffer, 0, size); } } catch (UnsupportedEncodingException e) { debug.write("Unsupported encoding exception " + e); event.write(e, null); encodingException = e; } removeBytes0(size); } else { result = new String(""); } if (encodingException != null) { throw encodingException; } return result; } ByteBuffer();  ByteBuffer(byte[] buffer); byte[] getBuffer(); void setBuffer(byte[] buffer); int length(); void appendByte(byte data); void appendShort(short data); void appendInt(int data); void appendCString(String string); void appendCString(String string, String encoding); void appendString(String string); void appendString(String string, String encoding); void appendString(String string, int count); void appendString(String string, int count, String encoding); void appendBuffer(ByteBuffer buf); void appendBytes(ByteBuffer bytes, int count); void appendBytes(byte[] bytes, int count); void appendBytes(byte[] bytes); byte removeByte(); short removeUnsignedByte(); short removeShort(); int removeInt(); int readInt(); String removeCString(); String removeCString(String encoding); String removeString(int size, String encoding); ByteBuffer removeBuffer(int count); ByteBuffer removeBytes(int count); void removeBytes0(int count); ByteBuffer readBytes(int count); String getHexDump(); }
ByteBuffer extends SmppObject { public String removeString(int size, String encoding) throws NotEnoughDataInByteBufferException, UnsupportedEncodingException { int len = length(); if (len < size) { throw new NotEnoughDataInByteBufferException(len, size); } UnsupportedEncodingException encodingException = null; String result = null; if (len > 0) { try { if (encoding != null) { result = new String(buffer, 0, size, encoding); } else { result = new String(buffer, 0, size); } } catch (UnsupportedEncodingException e) { debug.write("Unsupported encoding exception " + e); event.write(e, null); encodingException = e; } removeBytes0(size); } else { result = new String(""); } if (encodingException != null) { throw encodingException; } return result; } ByteBuffer();  ByteBuffer(byte[] buffer); byte[] getBuffer(); void setBuffer(byte[] buffer); int length(); void appendByte(byte data); void appendShort(short data); void appendInt(int data); void appendCString(String string); void appendCString(String string, String encoding); void appendString(String string); void appendString(String string, String encoding); void appendString(String string, int count); void appendString(String string, int count, String encoding); void appendBuffer(ByteBuffer buf); void appendBytes(ByteBuffer bytes, int count); void appendBytes(byte[] bytes, int count); void appendBytes(byte[] bytes); byte removeByte(); short removeUnsignedByte(); short removeShort(); int removeInt(); int readInt(); String removeCString(); String removeCString(String encoding); String removeString(int size, String encoding); ByteBuffer removeBuffer(int count); ByteBuffer removeBytes(int count); void removeBytes0(int count); ByteBuffer readBytes(int count); String getHexDump();  }