Skip to content

Commit cfcd2bf

Browse files
author
lesnail
committed
JAVA-378 reallocate buffer to correct size when changing chunksize of GridFSInputFile
1 parent a31e2e0 commit cfcd2bf

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/main/com/mongodb/gridfs/GridFSInputFile.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,7 @@ public void setChunkSize(long _chunkSize) {
144144
if (_outputStream != null || _savedChunks)
145145
return;
146146
this._chunkSize = _chunkSize;
147+
this._buffer = new byte[(int) _chunkSize];
147148
}
148149

149150
/**

0 commit comments

Comments
 (0)