ARTEMIS-490 Fixing new largeMessage copy
This commit is contained in:
parent
de0ac57aa4
commit
b89faae458
|
@ -276,6 +276,10 @@ public final class LargeServerMessageImpl extends ServerMessageImpl implements L
|
|||
try {
|
||||
LargeServerMessage newMessage = storageManager.createLargeMessage(newID, this);
|
||||
|
||||
boolean originallyOpen = file != null && file.isOpen();
|
||||
|
||||
validateFile();
|
||||
|
||||
|
||||
byte[] bufferBytes = new byte[100 * 1024];
|
||||
|
||||
|
@ -283,7 +287,6 @@ public final class LargeServerMessageImpl extends ServerMessageImpl implements L
|
|||
|
||||
long oldPosition = file.position();
|
||||
|
||||
boolean originallyOpen = file.isOpen();
|
||||
file.open();
|
||||
file.position(0);
|
||||
|
||||
|
@ -294,7 +297,7 @@ public final class LargeServerMessageImpl extends ServerMessageImpl implements L
|
|||
int bytesRead = file.read(buffer);
|
||||
|
||||
byte[] bufferToWrite;
|
||||
if (bytesRead == 0) {
|
||||
if (bytesRead <= 0) {
|
||||
break;
|
||||
}
|
||||
else if (bytesRead == bufferBytes.length) {
|
||||
|
|
Loading…
Reference in New Issue