code: private void writeFileByte(byte[] content, File file) throws IOException {
  
          FileOutputStream fOut = null;
          DataOutputStream dOut = null;
          try {
              // write the content to the file in server filesystem
              fOut = new FileOutputStream(file);
              dOut = new DataOutputStream(fOut);
              dOut.write(content);
              dOut.flush();
          } catch (IOException e) {
              throw e;
          } finally {
              try {
                  if (fOut != null) {
                      fOut.close();
                  }
              } catch (IOException e) {
                  // ignore
              }
              try {
                  if (dOut != null) {
                      dOut.close();
                  }
              } catch (IOException e) {
                  // ignore
              }
          }
      }
docs: This writes the byte content of a resource to the file on the server
  file system.<p>
  
  @param content the content of the file in the VFS
  @param file the file in SFS that has to be updated with content
  
  @throws IOException if something goes wrong