Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

Increase download buffer for a SCM file (now is only 16KB) - Java Plain API

Hello everyone,


I am downloading SCM files using this:
IFileContentManager contentManager = FileSystemCore.getContentManager(teamRepository)
IFileContent onlineFileContent = file.getContent();
FileOutputStream outputStream = new FileOutputStream(localPath);
contentManager.retrieveContent(file, onlineFileContent, outputStream, monitor2);



but I noticed that the transfer data buffer is aprox. 16KB each and every time:
Transferred 15.9 KB of 210.3 KB.
Transferred 31.9 KB of 210.3 KB.
Transferred 47.8 KB of 210.3 KB.
Transferred 63.8 KB of 210.3 KB.
Transferred 64.0 KB of 210.3 KB.
Transferred 79.9 KB of 210.3 KB.
Transferred 95.9 KB of 210.3 KB.
I tried modifying the code to work with a new buffer size:

IFileContentManager contentManager = FileSystemCore.getContentManager(teamRepository);

IFileContent onlineFileContent = file.getContent();


InputStream inputStream = contentManager.retrieveContentStream(file, onlineFileContent, monitor2);

int len = 50 * 1024;

byte[] dataBuffer = new byte[len];

BufferedInputStream in = new BufferedInputStream(inputStream, len);

FileOutputStream outputStream = new FileOutputStream(localPath);

int bytesRead;

while ((bytesRead = in.read(dataBuffer, 0, len)) != -1) {

outputStream.write(dataBuffer, 0, bytesRead);

outputStream.flush();

}


The bytesRead are still in the 16KB limit even though there's more space in the buffer. For me it seems that is something from the server side, where this limit is set. 
Do you know if it's possible to change this limit?

Thank you!

Regards,
Ana

0 votes


Be the first one to answer this question!

Register or log in to post your answer.

Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 10,927
× 1,201
× 17
× 13

Question asked: Mar 24 '22, 3:54 a.m.

Question was seen: 1,422 times

Last updated: Mar 24 '22, 3:58 a.m.

Confirmation Cancel Confirm