java - how to convertfrom long to String -
this question has answer here:
- how convert / cast long string? 7 answers
hi i'm trying convert long value string getting error type mismatch: cannot convert long string
this block of code please have look
urlconnection localurlconnection = new url("http://hugosys.in/sqlite/sk2.db").openconnection(); int = localurlconnection.getcontentlength(); bufferedinputstream localbufferedinputstream = new bufferedinputstream(localurlconnection.getinputstream()); bytearraybuffer localbytearraybuffer = new bytearraybuffer(1024); fileoutputstream localfileoutputstream = new fileoutputstream(download_db.this.dbfile); long l = 0l; (;;) { int j = localbufferedinputstream.read(); if (j == -1) { localfileoutputstream.flush(); localfileoutputstream.close(); return; } l += j; localbytearraybuffer.append((byte)j); if (localbytearraybuffer.length() > 2000) { byte[] arrayofbyte = localbytearraybuffer.tobytearray(); localbytearraybuffer.clear(); string[] arrayofstring = new string[1]; arrayofstring[0] = (l / i); publishprogress(arrayofstring); localfileoutputstream.write(arrayofbyte); } } return;
learn how use java api
long longvalue = 42l; string stringvalue = string.valueof(longvalue);
(http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/string.html#valueof(long))
Comments
Post a Comment