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