nicer serilization

This commit is contained in:
kimchy 2010-07-17 22:58:16 +03:00
parent 910ad2a408
commit 49f8501a5b
1 changed files with 4 additions and 4 deletions

View File

@ -780,7 +780,7 @@ public class RecoveryAction extends AbstractIndexShardComponent implements Close
}
synchronized (indexOutput) {
try {
indexOutput.writeBytes(request.content, request.content.length);
indexOutput.writeBytes(request.content, request.contentLength);
if (indexOutput.getFilePointer() == request.length) {
// we are done
indexOutput.close();
@ -804,8 +804,7 @@ public class RecoveryAction extends AbstractIndexShardComponent implements Close
long position;
long length;
byte[] content;
transient int contentLength;
int contentLength;
private FileChunk() {
}
@ -822,7 +821,8 @@ public class RecoveryAction extends AbstractIndexShardComponent implements Close
name = in.readUTF();
position = in.readVLong();
length = in.readVLong();
content = new byte[in.readVInt()];
contentLength = in.readVInt();
content = new byte[contentLength];
in.readFully(content);
}