Package org.mozilla.interfaces

Examples of org.mozilla.interfaces.nsISeekableStream


                {
                  nsIInputStream uploadStream = upload.getUploadStream();

                  if( uploadStream != null && uploadStream.available() > 0 )
                  {
                    nsISeekableStream seekable = ( nsISeekableStream )uploadStream
                        .queryInterface( nsISeekableStream.NS_ISEEKABLESTREAM_IID );

                    long pos = seekable.tell();
                    long available = uploadStream.available();

                    if( available > 0 )
                    {
                      try
                      {
                        synchronized( mozilla )
                        {
                          in.setInputStream( uploadStream );
                          requestData = in.readByteArray( available );
                          String requestBody = getRequestBody( requestData );
                          if( requestBody != null && requestBody.length() > 0 )
                          {
                            rr.setContent( requestBody );
                            String contentType = getContentType( requestData );
                            if( StringUtils.hasContent( contentType ) )
                              rr.setContentType( contentType );
                          }
                        }
                      }
                      catch( Throwable e )
                      {
                        e.printStackTrace();
                      }
                      finally
                      {
                        seekable.seek( nsISeekableStream.NS_SEEK_SET, pos );
                      }
                    }
                  }
                }
View Full Code Here

TOP

Related Classes of org.mozilla.interfaces.nsISeekableStream

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.