Code example for ProtocolVersion

Methods: forVersion

0
 try { 
   byte[] buffer = httpString.toString().getBytes();
   int readBytes;
   Log.d(LOG_TAG, "writing to client");
   client.getOutputStream().write(buffer, 0, buffer.length);
 
   // Start streaming content. 
   byte[] buff = new byte[1024 * 50];
   while (isRunning && (readBytes = data.read(buff, 0, buff.length)) != -1) {
     client.getOutputStream().write(buff, 0, readBytes);
   } 
 } catch (Exception e) {
   Log.e("", e.getMessage(), e);
 } finally { 
   if (data != null) {
     data.close();
   } 
   client.close();
 } 
}