private void initStreams() throws IOException { traceInput = new TraceInputStream(socket.getInputStream(), traceLogger); traceInput.setQuote(quote); input = new ResponseInputStream(traceInput); traceOutput = new TraceOutputStream(socket.getOutputStream(), traceLogger); traceOutput.setQuote(quote); output = new DataOutputStream(new BufferedOutputStream(traceOutput)); }
/** * Read a Response from the InputStream. * * @return ByteArray that contains the Response * @exception IOException for I/O errors */ public ByteArray readResponse() throws IOException { return readResponse(null); }
/** * Is another response available in our buffer? * * @return true if another response is in the buffer * @since JavaMail 1.5.4 */ public boolean hasResponse() { /* * XXX - Really should peek ahead in the buffer to see * if there's a *complete* response available, but if there * isn't who's going to read more data into the buffer * until there is? */ try { return input.available() > 0; } catch (IOException ex) { } return false; }
private void initStreams() throws IOException { traceInput = new TraceInputStream(socket.getInputStream(), traceLogger); traceInput.setQuote(quote); input = new ResponseInputStream(traceInput); traceOutput = new TraceOutputStream(socket.getOutputStream(), traceLogger); traceOutput.setQuote(quote); output = new DataOutputStream(new BufferedOutputStream(traceOutput)); }
/** * Read a Response from the InputStream. * * @return ByteArray that contains the Response * @exception IOException for I/O errors */ public ByteArray readResponse() throws IOException { return readResponse(null); }
/** * Is another response available in our buffer? * * @return true if another response is in the buffer * @since JavaMail 1.5.4 */ public boolean hasResponse() { /* * XXX - Really should peek ahead in the buffer to see * if there's a *complete* response available, but if there * isn't who's going to read more data into the buffer * until there is? */ try { return input.available() > 0; } catch (IOException ex) { } return false; }
/** * Constructor for debugging. * * @param in the InputStream to read from * @param out the PrintStream to write to * @param props Properties object used by this protocol * @param debug true to enable debugging output * @exception IOException for I/O errors */ public Protocol(InputStream in, PrintStream out, Properties props, boolean debug) throws IOException { this.host = "localhost"; this.props = props; this.quote = false; logger = new MailLogger(this.getClass(), "DEBUG", debug, System.out); traceLogger = logger.getSubLogger("protocol", null); // XXX - inlined initStreams, won't allow later startTLS traceInput = new TraceInputStream(in, traceLogger); traceInput.setQuote(quote); input = new ResponseInputStream(traceInput); traceOutput = new TraceOutputStream(out, traceLogger); traceOutput.setQuote(quote); output = new DataOutputStream(new BufferedOutputStream(traceOutput)); timestamp = System.currentTimeMillis(); }
/** * Read a new Response from the given Protocol * * @param p the Protocol object * @exception IOException for I/O errors * @exception ProtocolException for protocol failures */ public Response(Protocol p) throws IOException, ProtocolException { // read one response into 'buffer' ByteArray ba = p.getResponseBuffer(); ByteArray response = p.getInputStream().readResponse(ba); buffer = response.getBytes(); size = response.getCount() - 2; // Skip the terminating CRLF parse(); }
/** * Is another response available in our buffer? * * @return true if another response is in the buffer * @since JavaMail 1.5.4 */ public boolean hasResponse() { /* * XXX - Really should peek ahead in the buffer to see * if there's a *complete* response available, but if there * isn't who's going to read more data into the buffer * until there is? */ try { return input.available() > 0; } catch (IOException ex) { } return false; }
/** * Constructor for debugging. * * @param in the InputStream to read from * @param out the PrintStream to write to * @param props Properties object used by this protocol * @param debug true to enable debugging output * @exception IOException for I/O errors */ public Protocol(InputStream in, PrintStream out, Properties props, boolean debug) throws IOException { this.host = "localhost"; this.props = props; this.quote = false; tagPrefix = computePrefix(props, "mail.imap"); logger = new MailLogger(this.getClass(), "DEBUG", debug, System.out); traceLogger = logger.getSubLogger("protocol", null); // XXX - inlined initStreams, won't allow later startTLS traceInput = new TraceInputStream(in, traceLogger); traceInput.setQuote(quote); input = new ResponseInputStream(traceInput); traceOutput = new TraceOutputStream(out, traceLogger); traceOutput.setQuote(quote); output = new DataOutputStream(new BufferedOutputStream(traceOutput)); timestamp = System.currentTimeMillis(); }
/** * Read a new Response from the given Protocol * * @param p the Protocol object * @exception IOException for I/O errors * @exception ProtocolException for protocol failures */ public Response(Protocol p) throws IOException, ProtocolException { // read one response into 'buffer' ByteArray ba = p.getResponseBuffer(); ByteArray response = p.getInputStream().readResponse(ba); buffer = response.getBytes(); size = response.getCount() - 2; // Skip the terminating CRLF utf8 = p.supportsUtf8(); parse(); }
/** * Is another response available in our buffer? * * @return true if another response is in the buffer * @since JavaMail 1.5.4 */ public boolean hasResponse() { /* * XXX - Really should peek ahead in the buffer to see * if there's a *complete* response available, but if there * isn't who's going to read more data into the buffer * until there is? */ try { return input.available() > 0; } catch (IOException ex) { } return false; }
socket.getInputStream(), inf), traceLogger); traceInput.setQuote(quote); input = new ResponseInputStream(traceInput);
/** * Read a Response from the InputStream. * @return ByteArray that contains the Response */ public ByteArray readResponse() throws IOException { return readResponse(null); }
/** * Is another response available in our buffer? * * @return true if another response is in the buffer * @since JavaMail 1.5.4 */ public boolean hasResponse() { /* * XXX - Really should peek ahead in the buffer to see * if there's a *complete* response available, but if there * isn't who's going to read more data into the buffer * until there is? */ try { return input.available() > 0; } catch (IOException ex) { } return false; }
socket.getInputStream(), inf), traceLogger); traceInput.setQuote(quote); input = new ResponseInputStream(traceInput);
/** * Read a Response from the InputStream. * @return ByteArray that contains the Response */ public ByteArray readResponse() throws IOException { return readResponse(null); }
/** * Is another response available in our buffer? * * @return true if another response is in the buffer * @since JavaMail 1.5.4 */ public boolean hasResponse() { /* * XXX - Really should peek ahead in the buffer to see * if there's a *complete* response available, but if there * isn't who's going to read more data into the buffer * until there is? */ try { return input.available() > 0; } catch (IOException ex) { } return false; }
private void initStreams() throws IOException { traceInput = new TraceInputStream(socket.getInputStream(), traceLogger); traceInput.setQuote(quote); input = new ResponseInputStream(traceInput); traceOutput = new TraceOutputStream(socket.getOutputStream(), traceLogger); traceOutput.setQuote(quote); output = new DataOutputStream(new BufferedOutputStream(traceOutput)); }
/** * Read a Response from the InputStream. * * @return ByteArray that contains the Response * @exception IOException for I/O errors */ public ByteArray readResponse() throws IOException { return readResponse(null); }