Class SmtpResponseDecoder

    • Field Detail

      • DEFAULT_MAX_RESPONSE_SIZE

        private static final int DEFAULT_MAX_RESPONSE_SIZE
        See Also:
        Constant Field Values
      • maxResponseSize

        private final int maxResponseSize
      • details

        private java.util.List<java.lang.CharSequence> details
      • responseSize

        private long responseSize
    • Constructor Detail

      • SmtpResponseDecoder

        public SmtpResponseDecoder​(int maxLineLength)
        Creates a new instance that enforces the given maxLineLength and a default limit of 64 KiB on the accumulated size of a multi-line response.
        Parameters:
        maxLineLength - the maximum length of a single response line, in bytes.
      • SmtpResponseDecoder

        public SmtpResponseDecoder​(int maxLineLength,
                                   int maxResponseSize)
        Creates a new instance that enforces the given maxLineLength and maxResponseSize.

        The lines of a multi-line response are buffered until its terminating line arrives. maxResponseSize bounds that buffering. Once it is exceeded, decoding fails with a TooLongFrameException. The limit is approximate and tracks retained memory rather than bytes received, as it charges each buffered line a fixed object overhead in addition to its detail bytes, and ignores the response code, the separator and the terminating line.

        Parameters:
        maxLineLength - the maximum length of a single response line, in bytes.
        maxResponseSize - the maximum accumulated size of a multi-line response, in bytes.