// get IBB sessions data packet listener
InBandBytestreamSession session = new InBandBytestreamSession(connection, initBytestream,
initiatorJID);
InputStream inputStream = session.getInputStream();
PacketListener listener = Whitebox.getInternalState(inputStream, PacketListener.class);
// verify data packet and notify listener
for (int i = 0; i < controlData.length / blockSize; i++) {
String base64Data = StringUtils.encodeBase64(controlData, i * blockSize, blockSize,
false);
DataPacketExtension dpe = new DataPacketExtension(sessionID, i, base64Data);
Message dataMessage = new Message();
dataMessage.addExtension(dpe);
listener.processPacket(dataMessage);
}
byte[] bytes = new byte[3 * blockSize];
int read = 0;
read = inputStream.read(bytes, 0, blockSize);