I created a patch to improve the In-Band Bytestream feature for Smack. The patch introduces a new API that allows you create bidirectional In-Band Bytestreams. So IBB is not limited to be used with the unidirectional file transfers anymore.
The patch fully implements the XEP-0047 specification. The old file transfer API used message stanzas to send the IBB data packets. This is not the recommended way anymore, instead IQ stanzas should be used. The implementation supports both but now IQ stanzas are used by default.
The new API is well documented and fully tested (> 70 test cases). Usage is analogue to the API from my improved Socks5 bytestream patch.
The patch is splitted into four parts (some of them are the same as for the revised Socks5 patch):
The first adds a convenience class for the ConnectionListener which contains empty implementations for all methods of the ConnectionListener. This is useful if you only want to implement some of the methods and it makes the code look much nicer.
The second patch is the improved implementation of the In-Band Bytestream feature.
The third patch contains Utility classes for unit testing. These require the mockito and powermock libraries.
The last patch contains the test cases for the improved In-Band Bytestream implementation and additionally requires the java-xmlbuilder library.
Download the libraries here:
I’ve also added a small patch that has to be applied if you want to integrate the Socks5 bytestream patch and the In-Band Bytestream patch.
Hope you like the patch.
It would be great if somebody could take the time to review this patch (or one of my other patches ) so that they can be commited to the Smack SVN one day.
convenience_class_for_connection_listener.patch.zip (602 Bytes)
improve_in_band_bytestream.patch.zip (18552 Bytes)
unit_test_utilities.patch.zip (3564 Bytes)
improve_in_band_bytestream_tests.patch.zip (9923 Bytes)
socks5_and_ibb.patch.zip (795 Bytes)