code: public void setFixedLengthStreamingMode (int contentLength) {
          if (connected) {
              throw new IllegalStateException ("Already connected");
          }
          if (chunkLength != -1) {
              throw new IllegalStateException ("Chunked encoding streaming mode set");
          }
          if (contentLength < 0) {
              throw new IllegalArgumentException ("invalid content length");
          }
          fixedContentLength = contentLength;
      }
docs: This method is used to enable streaming of a HTTP request body
  without internal buffering, when the content length is known in
  advance.
  <p>
  An exception will be thrown if the application
  attempts to write more data than the indicated
  content-length, or if the application closes the OutputStream
  before writing the indicated amount.
  <p>
  When output streaming is enabled, authentication
  and redirection cannot be handled automatically.
  A HttpRetryException will be thrown when reading
  the response if authentication or redirection are required.
  This exception can be queried for the details of the error.
  <p>
  This method must be called before the URLConnection is connected.
  <p>
  <B>NOTE:</B> {@link #setFixedLengthStreamingMode(long)} is recommended
  instead of this method as it allows larger content lengths to be set.
  
  @param   contentLength The number of bytes which will be written
  to the OutputStream.
  
  @throws  IllegalStateException if URLConnection is already connected
  or if a different streaming mode is already enabled.
  
  @throws  IllegalArgumentException if a content length less than
  zero is specified.
  
  @see     #setChunkedStreamingMode(int)
  @since 1.5