Examples of writeTo()


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

    public void writeTo(Object obj, String mimeType, OutputStream os) throws IOException {
        if (obj instanceof MimeMultipart) {
            MimeMultipart mp = (MimeMultipart) obj;
            try {
                mp.writeTo(os);
            } catch (MessagingException e) {
                throw (IOException) new IOException(e.getMessage()).initCause(e);
            }
        }
    }
View Full Code Here

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

    // Initialize a byte array for containing the message body

    if (DebugFile.trace) DebugFile.writeln("ByteArrayOutputStream byOutStrm = new ByteArrayOutputStream("+String.valueOf(oText.getSize()>0 ? oText.getSize() : 8192)+")");

    byStrm = new ByteArrayOutputStream(oText.getSize()>0 ? oText.getSize() : 8192);
    oText.writeTo(byStrm);

    if (DebugFile.trace) {
      DebugFile.decIdent();
      DebugFile.writeln("End DBFolder.getBodyAsStream() : " + Gadgets.left(new String(byStrm.toByteArray()),100));
    }
View Full Code Here

Examples of javax.ws.rs.ext.MessageBodyWriter.writeTo()

         if (size > -1) response.getOutputHeaders().putSingle(HttpHeaderNames.CONTENT_LENGTH, String.valueOf(size));


         if (messageBodyWriterInterceptors == null || messageBodyWriterInterceptors.length == 0)
         {
            writer.writeTo(ent, type, generic, annotations,
                    contentType, getMetadata(), os);
         }
         else
         {
            ServerMessageBodyWriterContext ctx = new ServerMessageBodyWriterContext(messageBodyWriterInterceptors, writer, ent, type, generic,
View Full Code Here

Examples of javax.xml.ws.wsaddressing.W3CEndpointReference.writeTo()

                                                                      portName, null, "wsdlLoc",
                                                                      null);
       
        java.io.StringWriter sw = new java.io.StringWriter();
        StreamResult result = new StreamResult(sw);
        w3Epr.writeTo(result);
        String expected = "<wsdl:definitions";
        assertTrue("Embeded wsdl element is not generated", sw.toString().indexOf(expected) > -1);
        assertTrue("wsdlLocation attribute has the wrong value",
                   sw.toString().contains("wsdli:wsdlLocation=\"http://cxf.apache.org wsdlLoc\""));
    }
View Full Code Here

Examples of muduo.rpc.proto.RpcProto.RpcMessage.writeTo()

        ChannelBuffer buffer = new BigEndianHeapChannelBuffer(4 + size + 4);
        buffer.writeBytes("RPC0".getBytes());
        int writerIndex = buffer.writerIndex();
        CodedOutputStream output = CodedOutputStream.newInstance(
                buffer.array(), buffer.writerIndex(), buffer.writableBytes() - 4);
        message.writeTo(output);
        output.checkNoSpaceLeft();

        buffer.writerIndex(writerIndex + size);
        Adler32 checksum = new Adler32();
        checksum.update(buffer.array(), buffer.arrayOffset(), buffer.readableBytes());
View Full Code Here

Examples of net.htmlparser.jericho.OutputDocument.writeTo()

    }
   
    FileWriter out;
    try {
      out = new FileWriter(targetFilename);
      outputDocument.writeTo(out);
      //out.flush();
      //out.close();
    } catch (IOException e2) {
      System.err.println("Error while writing to file " + targetFilename);
      return false;
View Full Code Here

Examples of net.timewalker.ffmq3.utils.RawDataBuffer.writeTo()

        // Do we have a cached version of the raw message ?
      RawDataBuffer rawMsg = message.getRawMessage();
        if (rawMsg != null)
        {
          out.writeInt(rawMsg.size());
          rawMsg.writeTo(out);
        }
        else
        {
            // Serialize the message
          out.writeInt(0); // Write a dummy size
View Full Code Here

Examples of net.timewalker.ffmq3.utils.Settings.writeTo()

                throw new FFMQException("Queue descriptor already exists : "+queueDescriptor.getAbsolutePath(),"FS_ERROR");
           
            // Create the descriptor file
            log.debug("Persisting queue definition for "+queueDef.getName());
            Settings queueSettings = queueDef.asSettings();
            queueSettings.writeTo(queueDescriptor, "Queue definition descriptor for "+queueDef.getName());
        }
       
        // Register it
        queueDefinitions.put(queueDef.getName(), queueDef);
    }
View Full Code Here

Examples of net.yacy.cora.protocol.http.HTTPClient.writeTo()

                      int l = responseHeader.size();
                        final ByteArrayOutputStream byteStream = new ByteArrayOutputStream((l < 32) ? 32 : l);

                        final OutputStream toClientAndMemory = new MultiOutputStream(new OutputStream[] {outStream, byteStream});
//                        FileUtils.copy(res.getDataAsStream(), toClientAndMemory);
                        client.writeTo(toClientAndMemory);
                        // cached bytes
                        byte[] cacheArray;
                        if (byteStream.size() > 0) {
                            cacheArray = byteStream.toByteArray();
                        } else {
View Full Code Here

Examples of net.yacy.kelondro.util.ByteBuffer.writeTo()

                        final ByteBuffer result = RasterPlotter.exportImage(yp.getImage(), targetExt);

                        // write the array to the client
                        HTTPDemon.sendRespondHeader(conProp, out, httpVersion, 200, null, mimeType, result.length(), targetDate, null, null, null, null, nocache);
                        if (!method.equals(HeaderFramework.METHOD_HEAD)) {
                            result.writeTo(out);
                        }
                    }
                    if (img instanceof EncodedImage) {
                        final EncodedImage yp = (EncodedImage) img;
                        // send an image to client
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.