Mercurial > hg > Database > Christie
changeset 124:cd4b67334b17
fix msgpack downgrade remotetakecommand
author | akahori |
---|---|
date | Sat, 15 Dec 2018 17:57:34 +0900 |
parents | d92f0bbad1eb |
children | 136d2a6cd0f4 |
files | src/main/java/christie/datagear/command/RemoteTakeCommand.java |
diffstat | 1 files changed, 3 insertions(+), 7 deletions(-) [+] |
line wrap: on
line diff
--- a/src/main/java/christie/datagear/command/RemoteTakeCommand.java Sat Dec 15 17:49:57 2018 +0900 +++ b/src/main/java/christie/datagear/command/RemoteTakeCommand.java Sat Dec 15 17:57:34 2018 +0900 @@ -5,16 +5,13 @@ import christie.datagear.command.Command; import christie.datagear.command.CommandType; import christie.datagear.dg.MessagePackDataGear; -import com.fasterxml.jackson.databind.ObjectMapper; -import org.msgpack.jackson.dataformat.MessagePackFactory; +import org.msgpack.MessagePack; import java.io.IOException; import java.nio.ByteBuffer; public class RemoteTakeCommand extends Command { - ObjectMapper objectMapper = new ObjectMapper(new MessagePackFactory()); - public RemoteTakeCommand(RemoteMessage msg, Connection cn) { this.type = CommandType.REMOTETAKE; this.fromDgmName = msg.fromDgmName; @@ -40,11 +37,10 @@ @Override public ByteBuffer convert() { ByteBuffer buf = null; + MessagePack packer = new MessagePack(); try { - - byte[] command = objectMapper.writeValueAsBytes(createRemoteMessage()); - + byte[] command = packer.write(createRemoteMessage()); buf = ByteBuffer.allocate(command.length); buf.put(command);