protected CommandResponse execute(CommandPacket commandPacket) throws NfcException { byte[] result; if (this.felicaTag == null) { throw new NfcException("felicaTag is null!"); } try { if (!felicaTag.isConnected()) { felicaTag.connect(); } result = felicaTag.transceive(commandPacket.getBytes()); } catch (IOException e) { throw new NfcException(e); } return new CommandResponse(result); }
@Override public void write2Buffer(AbstractPacketBuffer myBuffer) throws UnsupportedEncodingException { super.write2Buffer(myBuffer); MysqlPacketBuffer buffer = (MysqlPacketBuffer) myBuffer; buffer.writeLong(statementId); }
@Override public void init(AbstractPacketBuffer myBuffer) { super.init(myBuffer); MysqlPacketBuffer buffer = (MysqlPacketBuffer) myBuffer; statementId = buffer.readLong(); }
/** * コンストラクタ * * @param response 他のレスポンスをセット */ public CommandPacket(CommandPacket command) { this(command.getBytes()); }