Code example for ProtocolException

0
    } 
 
    public long determineLength(final HttpMessage message) throws HttpException {
        final long result = this.contentLengthStrategy.determineLength(message);
        if (result == ContentLengthStrategy.IDENTITY) {
            throw new ProtocolException("Identity transfer encoding cannot be used");
        } 
        return result;
    } 
 
} 
Experience pair programming with AI  Get Codota for Java