Package com.trolltech.qt.core

Examples of com.trolltech.qt.core.QByteArray.toByteArray()


//    ByteArrayInputStream is = new ByteArrayInputStream(html);
        logger.log(logger.HIGH, "Starting JTidy check");
        logger.log(logger.EXTREME, "Start of JTidy Input");
        logger.log(logger.EXTREME, newContent);
        logger.log(logger.EXTREME, "End Of JTidy Input");
    ByteArrayInputStream is = new ByteArrayInputStream(unicode.toByteArray());
        ByteArrayOutputStream os = new ByteArrayOutputStream();
        tidy.setInputEncoding("UTF-8");
    tidy.parse(is, os);
    String tidyContent = os.toString();
    if (tidyListener.errorFound) {
View Full Code Here


         
          logger.log(logger.MEDIUM, "Starting JTidy check");
          logger.log(logger.MEDIUM, "Start of JTidy Input");
          logger.log(logger.MEDIUM, currentNote.getContent());
          logger.log(logger.MEDIUM, "End Of JTidy Input");
      ByteArrayInputStream is = new ByteArrayInputStream(unicode.toByteArray());
          ByteArrayOutputStream os = new ByteArrayOutputStream();
          tidy.setInputEncoding("UTF-8");
      tidy.parse(is, os);
      String tidyContent = os.toString();
      if (tidyListener.errorFound) {
View Full Code Here

              file.open(mode);
              QDataStream out = new QDataStream(file);
              Resource resBinary = conn.getNoteTable().noteResourceTable.getNoteResource(res.getGuid(), true);
          QByteArray binData = new QByteArray(resBinary.getData().getBody());
          resBinary = null;
              out.writeBytes(binData.toByteArray());
              file.close();
              PDFPreview pdfPreview = new PDFPreview();
          goodPreview = pdfPreview.setupPreview(file.fileName(), appl,0);
          if (goodPreview) {
            QDomElement span = doc.createElement("span");
View Full Code Here

            QDataStream out = new QDataStream(file);
            Resource resBinary = conn.getNoteTable().noteResourceTable.getNoteResource(res.getGuid(), true);
        QByteArray binData = new QByteArray(resBinary.getData().getBody());
        resBinary = null;
        logger.log(logger.EXTREME, "Writing resource");
            out.writeBytes(binData.toByteArray());
            file.close();
             
            String whichOS = System.getProperty("os.name");
        if (whichOS.contains("Windows"))
              url.setUrl("file:///"+file.fileName());
View Full Code Here

                String sf = fileNames.get(0);
                QFile saveFile = new QFile(sf);
                mode.set(QFile.OpenModeFlag.WriteOnly);
                saveFile.open(mode);
                QDataStream saveOut = new QDataStream(saveFile);
                saveOut.writeBytes(binData.toByteArray());
                saveFile.close();
                return;
              }
        }
      }
View Full Code Here

      path = Global.getFileManager().getResDirPath(newRes.getGuid()+".gif");
      tfile = new QFile(path);
      tfile.open(new QIODevice.OpenMode(QIODevice.OpenModeFlag.WriteOnly));
      tfile.write(image);
      tfile.close();
      newRes.getData().setBody(image.toByteArray());
      // Calculate the new hash value
        MessageDigest md;

        logger.log(logger.EXTREME, "Generating MD5");
        try {
View Full Code Here

        MessageDigest md;

        logger.log(logger.EXTREME, "Generating MD5");
        try {
        md = MessageDigest.getInstance("MD5");
          md.update(image.toByteArray());
          byte[] hash = md.digest();
          newRes.getData().setBodyHash(hash);
      } catch (NoSuchAlgorithmException e) {
        e.printStackTrace();
      }
View Full Code Here

            file.open(mode);
            QDataStream out = new QDataStream(file);
//            Resource resBinary = conn.getNoteTable().noteResourceTable.getNoteResource(newRes.getGuid(), true);
        QByteArray binData = new QByteArray(newRes.getData().getBody());
//        resBinary = null;
            out.writeBytes(binData.toByteArray());
            file.close();

        PDFPreview pdfPreview = new PDFPreview();
        if (pdfPreview.setupPreview(Global.getFileManager().getResDirPath(fileName), "pdf",0)) {
              imageURL = file.fileName() + ".png";
View Full Code Here

      QFile.OpenMode mode = new QFile.OpenMode();
      mode.set(QFile.OpenModeFlag.WriteOnly);
      saveFile.open(mode);
      QDataStream saveOut = new QDataStream(saveFile);
      QByteArray binData = new QByteArray(resBinary.getData().getBody());
      saveOut.writeBytes(binData.toByteArray());
      saveFile.close();

    }
  }
View Full Code Here

      QFile.OpenMode mode = new QFile.OpenMode();
      mode.set(QFile.OpenModeFlag.WriteOnly);
      saveFile.open(mode);
      QDataStream saveOut = new QDataStream(saveFile);
      QByteArray binData = new QByteArray(resBinary.getData().getBody());
      saveOut.writeBytes(binData.toByteArray());
      saveFile.close();
    }
  }

 
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.