Examples of SharedByteArrayOutputStream


Examples of com.ibm.commons.util.io.SharedByteArrayOutputStream

    // XSL transform
    if (true) {

      try {
        SharedByteArrayOutputStream baos = new SharedByteArrayOutputStream();
        StreamResult result = new StreamResult(baos);

        // read the log file
        StreamSource inputStream = new StreamSource(path + filename);
View Full Code Here

Examples of com.sun.mail.util.SharedByteArrayOutputStream

     * The size parameter indicates the expected size of the response;
     * the actual size can be different.  Returns an InputStream to the
     * response bytes.
     */
    private InputStream readMultilineResponse(int size) throws IOException {
  SharedByteArrayOutputStream buf = new SharedByteArrayOutputStream(size);
  int b, lastb = '\n';
  try {
      while ((b = input.read()) >= 0) {
    if (lastb == '\n' && b == '.') {
        if (debug && !traceSuspended)
      out.write(b);
        b = input.read();
        if (b == '\r') {
      if (debug && !traceSuspended)
          out.write(b);
      // end of response, consume LF as well
      b = input.read();
      if (debug && !traceSuspended)
          out.write(b);
      break;
        }
    }
    buf.write(b);
    if (debug && !traceSuspended)
        out.write(b);
    lastb = b;
      }
  } catch (InterruptedIOException iioex) {
      /*
       * As above in readResponse, close the socket to recover.
       */
      try {
    socket.close();
      } catch (IOException cex) { }
      throw iioex;
  }
  if (b < 0)
      throw new EOFException("EOF on socket");
  return buf.toStream();
    }
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.