Examples of writeTo()


Examples of java.io.ByteArrayOutputStream.writeTo()

    if (key == -1) {
      if (logger.isLoggable(BasicLevel.DEBUG))
        logger.log(BasicLevel.DEBUG, " -> connection opened, initializes new connection");
      StreamUtil.writeTo(reconnectTimeout, baos);
      baos.writeTo(os);
      os.flush();

      int len = StreamUtil.readIntFrom(is);
      long dt = StreamUtil.readLongFrom(is);
      if (dt > clockSynchroThreshold)
View Full Code Here

Examples of java.io.CharArrayWriter.writeTo()

                    try {
                        template.process(model, parentCharArrayWriter);

                        if (isTopTemplate) {
                            parentCharArrayWriter.flush();
                            parentCharArrayWriter.writeTo(writer);
                        }
                    } catch (TemplateException e) {
                        if (LOG.isErrorEnabled()) {
                            LOG.error("Error processing Freemarker result!", e);
                        }
View Full Code Here

Examples of javax.activation.DataContentHandler.writeTo()

            throw new WebApplicationException(500);
        }

        FlushHeadersOutputStream outputStream =
            new FlushHeadersOutputStream(httpResponse, httpHeaders);
        dataContentHandler.writeTo(entity, responseMediaType.toString(), outputStream);
        outputStream.flushHeaders();
    }

    @SuppressWarnings("unchecked")
    private static void flushHeaders(final HttpServletResponse httpResponse,
View Full Code Here

Examples of javax.activation.DataHandler.writeTo()

    URL oUrl = new URL(sFilePath);
   
    ByteArrayOutputStream oStrm = new ByteArrayOutputStream();
    DataHandler oHndlr = new DataHandler(oUrl);
    oHndlr.writeTo(oStrm);
    sRetVal = oStrm.toString(sEncoding);
    oStrm.close();

    return sRetVal;
  } // readfilestr
View Full Code Here

Examples of javax.mail.BodyPart.writeTo()

            if (null==sMsgCharSeq) DebugFile.writeln("characer sequence is null");
          }

          BodyPart oPart = oParts.getBodyPart(p);
          byOutPart = new ByteArrayOutputStream(oPart.getSize() > 0 ? oPart.getSize() : 131072);
          oPart.writeTo(byOutPart);

          if (sMsgCharSeq!=null && sBoundary!=null && iPrevPart>0) {
            iThisPart = sMsgCharSeq.indexOf(sBoundary, iPrevPart);
            if (iThisPart>0) {
              if (DebugFile.trace) DebugFile.writeln("found part " + String.valueOf(p+iOffset) + " boundary at " + String.valueOf(iThisPart));
View Full Code Here

Examples of javax.mail.Message.writeTo()

                child.setEncodingAndType(contentType);// Parse the content-type

                if (isStoreMimeMessage()) {
                    // Don't save headers - they are already in the raw message
                    ByteArrayOutputStream bout = new ByteArrayOutputStream();
                    message.writeTo(bout);
                    child.setResponseData(bout.toByteArray()); // Save raw message
                    child.setDataType(SampleResult.TEXT);
                } else {
                    @SuppressWarnings("unchecked") // Javadoc for the API says this is OK
                    Enumeration<Header> hdrs = message.getAllHeaders();
View Full Code Here

Examples of javax.mail.Multipart.writeTo()

        mp.addBodyPart(new MimeBodyPart(headers,certs[i].getEncoded()));
      }
      if (log.isTraceEnabled()) {
        log.trace("content type: "+mp.getContentType());       
      }
      mp.writeTo(resp.getOutputStream());
      resp.flushBuffer();
    } catch (CertificateEncodingException e) {
      throw new ServletException(e);
    } catch (MessagingException e) {
      throw new ServletException(e);
View Full Code Here

Examples of javax.mail.Part.writeTo()

   * @see javax.mail.Part#writeTo(java.io.OutputStream)
   */
  public void writeTo(OutputStream outStream) throws IOException,
  MessagingException {
    Part part = getPartOnFile();
    part.writeTo(outStream);
  }
 
  /*
   * (non-Javadoc)
   *
 
View Full Code Here

Examples of javax.mail.internet.MimeBodyPart.writeTo()

      sText = oOrMsg.tagBodyPlain();

    MimeBodyPart oText = new MimeBodyPart();
    oText.setContent(sText, "text/html");
    java.io.ByteArrayOutputStream oBaStrm = new java.io.ByteArrayOutputStream(sText.length()*2+2);
    oText.writeTo(oBaStrm);

    oStmt = oConn.prepareStatement("UPDATE "+DB.k_mime_msgs+" SET "+DB.len_mimemsg+"=?"+","+DB.tx_subject+"=?,"+DB.by_content+"=? WHERE "+DB.gu_mimemsg+"=?");
    oStmt.setInt(1, oBaStrm.size());
    oStmt.setString(2, oOrMsg.getSubject());
    oStmt.setBinaryStream(3, new java.io.ByteArrayInputStream(oBaStrm.toByteArray()), oBaStrm.size());
View Full Code Here

Examples of javax.mail.internet.MimeMessage.writeTo()

        currentFolder.open(Folder.READ_WRITE);
        MimeMessage cplMessage = (MimeMessage) currentFolder.getMessageByUID(messageUID);
   
        if (cplMessage != null) {
          cplMessage.setFlag(Flags.Flag.SEEN, true);
          cplMessage.writeTo(baos);
          baos.flush();
          bytearrayMessage = baos.toByteArray();
          baos.close();
          mLastModifiedDate = cplMessage.getSentDate();
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.