Mercurial > hg > Database > Alice
changeset 461:99e309768ac9 dispose
use zip method high cost. need improve
author | sugi |
---|---|
date | Mon, 03 Nov 2014 21:52:09 +0900 |
parents | 4e7514007ae1 |
children | b8b8ce9032f8 |
files | src/main/java/alice/datasegment/Command.java src/main/java/alice/datasegment/ReceiveData.java |
diffstat | 2 files changed, 3 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/src/main/java/alice/datasegment/Command.java Mon Nov 03 20:26:41 2014 +0900 +++ b/src/main/java/alice/datasegment/Command.java Mon Nov 03 21:52:09 2014 +0900 @@ -96,15 +96,15 @@ } else { // rData is RAW ByteArray or already serialized data = (byte[]) rData.getObj(); serialized = rData.serialized(); - } - if (compressFlag) { + } + if (compressFlag) { data = zip(data); compressed = true; } } header = msg.write(new CommandMessage(type.id, index, seq, key, false, serialized, compressed)); - dataSize = msg.write(data.length); + dataSize = msg.write(data.length); buf = ByteBuffer.allocate(header.length+dataSize.length+data.length); buf.put(header); buf.put(dataSize);