try {
is = new FileInputStream(file.getAbsolutePath());
for(int readed = is.read(buf);readed > 0;readed =is.read(buf))
{
String encoded = Base64.encodeBytes(buf,0,readed);
backend.send(new Message(null,to,new IBBExtension(sid,sequence,encoded)));
//TODO add message resultlistener instead of iqresultlistener
sequence++;
bytes+=readed;
if (Thread.interrupted())
{