Code example for ProtocolException

0
            String s = contentLengthHeader.getValue();
            try { 
                long len = Long.parseLong(s);
                return len;
            } catch (NumberFormatException e) {
                throw new ProtocolException("Invalid content length: " + s);
            } 
        } else { 
            return IDENTITY;
        } 
    } 
 
} 
Experience pair programming with AI  Get Codota for Java