private void openHttpsPostConnection(final String urlStr, final byte[] data, final int sampleRate) {
		new Thread () {
			public void run() {
				HttpsURLConnection httpConn = null;
				ByteBuffer buff = ByteBuffer.wrap(data);
				byte[] destdata = new byte[2048];
				int resCode = -1;
				OutputStream out = null;
				try {
					URL url = new URL(urlStr);
					URLConnection urlConn = url.openConnection();
					if (!(urlConn instanceof HttpsURLConnection)) {
						throw new IOException ("URL must be HTTPS");
					}
					httpConn = (HttpsURLConnection)urlConn;
					httpConn.setAllowUserInteraction(false);
					httpConn.setInstanceFollowRedirects(true);
					httpConn.setRequestMethod("POST");
					httpConn.setDoOutput(true);
					httpConn.setChunkedStreamingMode(0); //TransferType: chunked
					httpConn.setRequestProperty("Content-Type", "audio/x-flac; rate=" + sampleRate);
					// this opens a connection, then sends POST & headers.
					out = httpConn.getOutputStream();
					//beyond 15 sec duration just simply writing the file
					// does not seem to work. So buffer it and delay to simulate
					// bufferd microphone delivering stream of speech
					// re: net.http.ChunkedOutputStream.java
					while(buff.remaining() >= destdata.length){
						buff.get(destdata);
						out.write(destdata);
					};
					byte[] lastr = new byte[buff.remaining()];
					buff.get(lastr, 0, lastr.length);
					out.write(lastr);
					out.close();					
					if(resCode >= HttpURLConnection.HTTP_UNAUTHORIZED){//Stops here if Google doesn't like us/
						throw new HTTPException(HttpURLConnection.HTTP_UNAUTHORIZED);//Throws
					}
					String line;//Each line that is read back from Google.
					BufferedReader br =	new BufferedReader(new InputStreamReader(httpConn.getInputStream()));
					while ((line = br.readLine( )) != null) {
						if(line.length()>19 && resCode > 100 && resCode < HttpURLConnection.HTTP_UNAUTHORIZED){
							GoogleResponse gr = new GoogleResponse();
							parseResponse(line, gr);
							fireResponseEvent(gr);
						}
					}
				} catch (MalformedURLException e) {
					e.printStackTrace();
				} catch (IOException e) {
					e.printStackTrace();
				}
				finally {httpConn.disconnect();}
			}
		}.start();
	}