title: i want to read bytes from vpninterface and then write back to it
body: <p>i have setup a vpn service and then configure a vpn interface.</p>
  <pre><code> private void setupVPN() {
          try {
              if (vpnInterface == null) {
                  Builder builder = new Builder();
                  builder.addAddress(VPN_ADDRESS, 32);
                  builder.addRoute(VPN_ROUTE, 0);
                  builder.setMtu(1499);
                  vpnInterface = builder.setSession(getString(R.string.app_name)).setConfigureIntent(pendingIntent).establish();
  
              }
          } catch (Exception e) {
              Log.e(TAG, &quot;error&quot;, e);
              System.exit(0);
          }
      }
  </code></pre>
  <p>i can read bytes from File Descriptor but how to write them back.</p>
  <pre><code> FileChannel vpnInput = new FileInputStream(vpnFileDescriptor).getChannel();
              FileChannel vpnOutput = new FileOutputStream(vpnFileDescriptor).getChannel();
              Thread t = new Thread(new WriteVpnThread(vpnOutput, networkToDeviceQueue));
              t.start();
  
              try {
                  ByteBuffer bufferToNetwork = null;
                  while (!Thread.interrupted()) {
                      bufferToNetwork = ByteBufferPool.acquire();
                      int readBytes = vpnInput.read(bufferToNetwork);
                      if (readBytes &gt; 0) {
  
                         bufferToNetwork.flip();
                      }
                  }
              }
  </code></pre>
  <p>do i have to parse them and then write it back or is there any other way?</p>