Tabnine Logo
TraceInputStream
Code IndexAdd Tabnine to your IDE (free)

How to use
TraceInputStream
in
com.sun.mail.util

Best Java code snippets using com.sun.mail.util.TraceInputStream (Showing top 20 results out of 315)

origin: camunda/camunda-bpm-platform

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));
}
origin: camunda/camunda-bpm-platform

/**
 * Resume protocol tracing, if it was enabled to begin with.
 */
protected void resumeTracing() {
if (traceLogger.isLoggable(Level.FINEST)) {
  traceInput.setTrace(true);
  traceOutput.setTrace(true);
}
}
origin: camunda/camunda-bpm-platform

/**
 * Reads the next byte of data from this input stream. Returns
 * <code>-1</code> if no data is available. Writes out the read
 * byte into the trace stream, if trace mode is <code>true</code>
 */
public int read() throws IOException {
int b = in.read();
if (trace && b != -1) {
  if (quote)
  writeByte(b);
  else
  traceOut.write(b);
}
return b;
}
origin: javax.mail/com.springsource.javax.mail

private void initStreams(PrintStream out) throws IOException {
traceInput = new TraceInputStream(socket.getInputStream(), out);
traceInput.setTrace(debug);
traceInput.setQuote(quote);
input = new ResponseInputStream(traceInput);
traceOutput = new TraceOutputStream(socket.getOutputStream(), out);
traceOutput.setTrace(debug);
traceOutput.setQuote(quote);
output = new DataOutputStream(new BufferedOutputStream(traceOutput));
}
origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.javax.mail

private void initStreams(PrintStream out) throws IOException {
traceInput = new TraceInputStream(socket.getInputStream(), out);
traceInput.setTrace(debug);
traceInput.setQuote(quote);
input = new ResponseInputStream(traceInput);
traceOutput = new TraceOutputStream(socket.getOutputStream(), out);
traceOutput.setTrace(debug);
traceOutput.setQuote(quote);
output = new DataOutputStream(new BufferedOutputStream(traceOutput));
}
origin: com.sun.mail/javax.mail

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));
}
origin: javax.mail/com.springsource.javax.mail

/**
 * Constructor for debugging.
 */
public Protocol(InputStream in, OutputStream out, boolean debug)
      throws IOException {
this.host = "localhost";
this.debug = debug;
this.quote = false;
this.out = System.out;
// XXX - inlined initStreams, won't allow later startTLS
traceInput = new TraceInputStream(in, System.out);
traceInput.setTrace(debug);
traceInput.setQuote(quote);
input = new ResponseInputStream(traceInput);
traceOutput = new TraceOutputStream(out, System.out);
traceOutput.setTrace(debug);
traceOutput.setQuote(quote);
output = new DataOutputStream(new BufferedOutputStream(traceOutput));
  timestamp = System.currentTimeMillis();
}
origin: camunda/camunda-bpm-platform

/**
 * Temporarily turn off protocol tracing, e.g., to prevent
 * tracing the authentication sequence, including the password.
 */
protected void suspendTracing() {
if (traceLogger.isLoggable(Level.FINEST)) {
  traceInput.setTrace(false);
  traceOutput.setTrace(false);
}
}
origin: com.sun.mail/javax.mail

/**
 * Reads the next byte of data from this input stream. Returns
 * <code>-1</code> if no data is available. Writes out the read
 * byte into the trace stream, if trace mode is <code>true</code>
 */
@Override
public int read() throws IOException {
int b = in.read();
if (trace && b != -1) {
  if (quote)
  writeByte(b);
  else
  traceOut.write(b);
}
return b;
}
origin: camunda/camunda-bpm-platform

private void initStreams() throws IOException {
boolean quote = PropUtil.getBooleanProperty(props,
        "mail.debug.quote", false);
traceInput =
  new TraceInputStream(socket.getInputStream(), traceLogger);
traceInput.setQuote(quote);
traceOutput =
  new TraceOutputStream(socket.getOutputStream(), traceLogger);
traceOutput.setQuote(quote);
// should be US-ASCII, but not all JDK's support it so use iso-8859-1
input = new BufferedReader(new InputStreamReader(traceInput,
              "iso-8859-1"));
output = new PrintWriter(
    new BufferedWriter(
    new OutputStreamWriter(traceOutput, "iso-8859-1")));
}
origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.javax.mail

/**
 * Constructor for debugging.
 */
public Protocol(InputStream in, OutputStream out, boolean debug)
      throws IOException {
this.host = "localhost";
this.debug = debug;
this.quote = false;
this.out = System.out;
// XXX - inlined initStreams, won't allow later startTLS
traceInput = new TraceInputStream(in, System.out);
traceInput.setTrace(debug);
traceInput.setQuote(quote);
input = new ResponseInputStream(traceInput);
traceOutput = new TraceOutputStream(out, System.out);
traceOutput.setTrace(debug);
traceOutput.setQuote(quote);
output = new DataOutputStream(new BufferedOutputStream(traceOutput));
  timestamp = System.currentTimeMillis();
}
origin: camunda/camunda-bpm-platform

/**
 * Temporarily turn off protocol tracing, e.g., to prevent
 * tracing the authentication sequence, including the password.
 */
private void suspendTracing() {
if (traceLogger.isLoggable(Level.FINEST)) {
  traceInput.setTrace(false);
  traceOutput.setTrace(false);
}
}
origin: camunda/camunda-bpm-platform

/**
 * Reads up to <code>len</code> bytes of data from this input stream
 * into an array of bytes. Returns <code>-1</code> if no more data
 * is available. Writes out the read bytes into the trace stream, if 
 * trace mode is <code>true</code>
 */
public int read(byte b[], int off, int len) throws IOException {
int count = in.read(b, off, len);
if (trace && count != -1) {
  if (quote) {
  for (int i = 0; i < count; i++)
    writeByte(b[off + i]);
  } else
  traceOut.write(b, off, count);
}
return count;
}
origin: com.sun.mail/javax.mail

private void initStreams() throws IOException {
boolean quote = PropUtil.getBooleanProperty(props,
        "mail.debug.quote", false);
traceInput =
  new TraceInputStream(socket.getInputStream(), traceLogger);
traceInput.setQuote(quote);
traceOutput =
  new TraceOutputStream(socket.getOutputStream(), traceLogger);
traceOutput.setQuote(quote);
// should be US-ASCII, but not all JDK's support it so use iso-8859-1
input = new BufferedReader(new InputStreamReader(traceInput,
              "iso-8859-1"));
output = new PrintWriter(
    new BufferedWriter(
    new OutputStreamWriter(traceOutput, "iso-8859-1")));
}
origin: javax.mail/com.springsource.javax.mail

private void initStreams() throws IOException {
PrintStream out = session.getDebugOut();
boolean quote = PropUtil.getBooleanSessionProperty(session,
        "mail.debug.quote", false);
traceInput = new TraceInputStream(serverSocket.getInputStream(), out);
traceInput.setTrace(debug);
traceInput.setQuote(quote);
traceOutput =
  new TraceOutputStream(serverSocket.getOutputStream(), out);
traceOutput.setTrace(debug);
traceOutput.setQuote(quote);
serverOutput =
  new BufferedOutputStream(traceOutput);
serverInput =
  new BufferedInputStream(traceInput);
lineInputStream = new LineInputStream(serverInput);
}
origin: camunda/camunda-bpm-platform

/**
 * Resume protocol tracing, if it was enabled to begin with.
 */
private void resumeTracing() {
if (traceLogger.isLoggable(Level.FINEST)) {
  traceInput.setTrace(true);
  traceOutput.setTrace(true);
}
}
origin: com.sun.mail/javax.mail

/**
 * Reads up to <code>len</code> bytes of data from this input stream
 * into an array of bytes. Returns <code>-1</code> if no more data
 * is available. Writes out the read bytes into the trace stream, if 
 * trace mode is <code>true</code>
 */
@Override
public int read(byte b[], int off, int len) throws IOException {
int count = in.read(b, off, len);
if (trace && count != -1) {
  if (quote) {
  for (int i = 0; i < count; i++)
    writeByte(b[off + i]);
  } else
  traceOut.write(b, off, count);
}
return count;
}
origin: camunda/camunda-bpm-platform

private void initStreams() throws IOException {
boolean quote = PropUtil.getBooleanSessionProperty(session,
        "mail.debug.quote", false);
traceInput =
  new TraceInputStream(serverSocket.getInputStream(), traceLogger);
traceInput.setQuote(quote);
traceOutput =
  new TraceOutputStream(serverSocket.getOutputStream(), traceLogger);
traceOutput.setQuote(quote);
serverOutput =
  new BufferedOutputStream(traceOutput);
serverInput =
  new BufferedInputStream(traceInput);
lineInputStream = new LineInputStream(serverInput);
}
origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.javax.mail

private void initStreams() throws IOException {
Properties props = session.getProperties();
PrintStream out = session.getDebugOut();
boolean debug = session.getDebug();
String s = props.getProperty("mail.debug.quote");
boolean quote = s != null && s.equalsIgnoreCase("true");
TraceInputStream traceInput =
  new TraceInputStream(serverSocket.getInputStream(), out);
traceInput.setTrace(debug);
traceInput.setQuote(quote);
TraceOutputStream traceOutput =
  new TraceOutputStream(serverSocket.getOutputStream(), out);
traceOutput.setTrace(debug);
traceOutput.setQuote(quote);
serverOutput =
  new BufferedOutputStream(traceOutput);
serverInput =
  new BufferedInputStream(traceInput);
lineInputStream = new LineInputStream(serverInput);
}
origin: com.sun.mail/javax.mail

/**
 * Temporarily turn off protocol tracing, e.g., to prevent
 * tracing the authentication sequence, including the password.
 */
private void suspendTracing() {
if (traceLogger.isLoggable(Level.FINEST)) {
  traceInput.setTrace(false);
  traceOutput.setTrace(false);
}
}
com.sun.mail.utilTraceInputStream

Javadoc

This class is a FilterInputStream that writes the bytes being read from the given input stream into the given output stream. This class is typically used to provide a trace of the data that is being retrieved from an input stream.

Most used methods

  • <init>
    Creates an input stream filter built on top of the specified input stream.
  • setQuote
    Set quote mode.
  • setTrace
    Set trace mode.
  • writeByte
    Write a byte in a way that every byte value is printable ASCII.

Popular in Java

  • Reading from database using SQL prepared statement
  • requestLocationUpdates (LocationManager)
  • getContentResolver (Context)
  • getApplicationContext (Context)
  • ObjectMapper (com.fasterxml.jackson.databind)
    ObjectMapper provides functionality for reading and writing JSON, either to and from basic POJOs (Pl
  • ResultSet (java.sql)
    An interface for an object which represents a database table entry, returned as the result of the qu
  • DecimalFormat (java.text)
    A concrete subclass of NumberFormat that formats decimal numbers. It has a variety of features desig
  • ArrayList (java.util)
    ArrayList is an implementation of List, backed by an array. All optional operations including adding
  • CountDownLatch (java.util.concurrent)
    A synchronization aid that allows one or more threads to wait until a set of operations being perfor
  • Base64 (org.apache.commons.codec.binary)
    Provides Base64 encoding and decoding as defined by RFC 2045.This class implements section 6.8. Base
  • Top plugins for Android Studio
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now