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