views:

69

answers:

1
            int start=0,flag=1;
            long size=blobInfo.getSize(),fetched=0,fetch;
            byte temp[] = null;

            while(fetched<size){
               if(size-fetched>MAX_BLOB_FETCH_SIZE)
                    fetch=MAX_BLOB_FETCH_SIZE;
               else
                    fetch=size-fetched;

               temp=blobstoreService.fetchData(blobKey,fetched,fetch );

               fetched+=fetch;
               out.println(temp);
        }

i tried to print the data of the uploaded text file using the above code but it doesn't seem to be working .

+1  A: 

i got it worked out. as

while(blobInfo.getSize()>positionInBlob){ long endIndex=Math.min(blobInfo.getSize(),positionInBlob+chunkSize); chunk=blobstoreService.fetchData(blobKey,positionInBlob, endIndex); positionInBlob+=chunk.length;

         for(int j=0;j<chunk.length;j++){
             int c=chunk[j];
             out.println((char)c);
         }

     }
Bunny Rabbit