default long getAttributeValueAsLong (@Nullable final IMicroQName aAttrName, final long nDefault) { return StringParser.parseLong (getAttributeValue (aAttrName), nDefault); }
default long getAttributeValueAsLong (@Nullable final String sNamespaceURI, @Nullable final String sAttrName, final long nDefault) { return StringParser.parseLong (getAttributeValue (sNamespaceURI, sAttrName), nDefault); }
private long _getContentLength (@Nonnull final IFileItemHeaders aHeaders) { return StringParser.parseLong (aHeaders.getHeaderContentLength (), -1L); }
/** * Get the content length of the passed request. This is not done using * <code>request.getContentLength()</code> but instead parsing the HTTP header * field {@link CHttpHeader#CONTENT_LENGTH} manually! * * @param aHttpRequest * Source HTTP request. May not be <code>null</code>. * @return -1 if no or an invalid content length is set in the header */ @CheckForSigned public static long getContentLength (@Nonnull final HttpServletRequest aHttpRequest) { ValueEnforcer.notNull (aHttpRequest, "HttpRequest"); if (false) { // Missing support > 2GB!!! return aHttpRequest.getContentLength (); } final String sContentLength = aHttpRequest.getHeader (CHttpHeader.CONTENT_LENGTH); return StringParser.parseLong (sContentLength, -1L); }
final long nContentLength = StringParser.parseLong (aMDN.getHeader (CHttpHeader.CONTENT_LENGTH), -1); if (nContentLength >= 0) StreamHelper.copyInputStreamToOutputStreamWithLimit (aIS, aMDNStream, nContentLength);
final long nContentLength = StringParser.parseLong (aMDN.getHeader (CHttpHeader.CONTENT_LENGTH), -1); if (nContentLength >= 0) StreamHelper.copyInputStreamToOutputStreamWithLimit (aConnIS, aMDNStream, nContentLength);