java - How to receive base64 conversion [audio file] through TCP/IP with less seconds? -
case: 2 different linux machine. client machine running on 'c'programming , sever receiving machine running on java.
my code:
appendedlen = "2687868"; int lengthtocheck= infromclient.read(ch, 0, ch.length); while (appendedlen >= lengthtocheck) { request = request + string.valueof(ch).trim(); if ((appendedlen - lengthtocheck) != 0) { ch = new char[appendedlen - actuallen]; actuallen = infromclient.read(ch, 0, ch.length); lengthtocheck = lengthtocheck + actuallen; } else { (" received entire response"); break; } }
for receiving, take 6-7 mins.
get inputstream socket , use apache commons read byte[] follows
ioutils.tobytearray(inputstream)
Comments
Post a Comment