Drazen Bjelovuk
Drazen Bjelovuk

Reputation: 5492

IOUtils.copy up to specified length

I noticed there doesn't seem to be a way to specify a length of bytes for the copy method. copyLarge(InputStream input, OutputStream output, long inputOffset, long length) is basically what I'm looking for, but the API asserts this is meant for files over 2GB, which is not necessarily the case for me.

Upvotes: 1

Views: 1208

Answers (1)

user987339
user987339

Reputation: 10727

copyLarge(InputStream input, OutputStream output, long inputOffset, long length) is using copy buffer of 4kb. So you can use it also for smaller files.

Upvotes: 2

Related Questions