Win a copy of Java EE 8 High Performance this week in the Java/Jakarta EE forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

getContentLength() clarification  RSS feed

Ranch Hand
Posts: 294
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm working on fixing Slide bug "can't handle files > 2GB". The problem issued that content length is bigger than MAX_INT. Spec for getContentLength() states:

Returns the length, in bytes, of the request body and made available by the input stream, or -1 if the length is not known. For HTTP servlets, same as the value of the CGI variable CONTENT_LENGTH.

an integer containing the length of the request body or -1 if the length is not known

What should I expect from this method for content length > 2GB? -1 ? Wrong, because content length is known. If there is somebody from servlet API group, then please clarify.
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!