You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by di...@apache.org on 2004/04/11 13:07:28 UTC

cvs commit: ws-axis/java/src/org/apache/axis/attachments ManagedMemoryDataSource.java

dims        2004/04/11 04:07:28

  Modified:    java/src/org/apache/axis/attachments
                        ManagedMemoryDataSource.java
  Log:
  Possible fix for AXIS-1203 - Attachments: createAttachmentPart broken (or setContent)
  
  Revision  Changes    Path
  1.33      +6 -1      ws-axis/java/src/org/apache/axis/attachments/ManagedMemoryDataSource.java
  
  Index: ManagedMemoryDataSource.java
  ===================================================================
  RCS file: /home/cvs/ws-axis/java/src/org/apache/axis/attachments/ManagedMemoryDataSource.java,v
  retrieving revision 1.32
  retrieving revision 1.33
  diff -u -r1.32 -r1.33
  --- ManagedMemoryDataSource.java	25 Feb 2004 14:02:30 -0000	1.32
  +++ ManagedMemoryDataSource.java	11 Apr 2004 11:07:28 -0000	1.33
  @@ -22,6 +22,7 @@
   import org.apache.commons.logging.Log;
   
   import java.io.File;
  +import java.io.BufferedInputStream;
   
   /**
    * This class allows small attachments to be cached in memory, while large ones are
  @@ -116,7 +117,11 @@
               java.io.InputStream ss, int maxCached, String contentType, boolean readall)
               throws java.io.IOException {
   
  -        this.ss = ss;
  +        if(ss instanceof BufferedInputStream) {
  +            this.ss = ss;
  +        } else {
  +            this.ss = new BufferedInputStream(ss);
  +        }
           this.maxCached = maxCached;
   
           if ((null != contentType) && (contentType.length() != 0)) {