@Override public void parse(NulsByteBuffer byteBuffer) throws NulsException { bytes = byteBuffer.readByLengthByte(); }
@Override public void parse(NulsByteBuffer byteBuffer) throws NulsException { this.address = byteBuffer.readByLengthByte(); this.alias = byteBuffer.readString(); } }
@Override public void parse(NulsByteBuffer byteBuffer) throws NulsException { this.signAlgType = byteBuffer.readByte(); this.signBytes = byteBuffer.readByLengthByte(); }
@Override public void parse(NulsByteBuffer byteBuffer) throws NulsException { digestAlgType = byteBuffer.readByte(); this.digestBytes = byteBuffer.readByLengthByte(); }
@Override public void parse(NulsByteBuffer byteBuffer) throws NulsException { this.setVal(byteBuffer.readByLengthByte()); } }
@Override public void parse(NulsByteBuffer byteBuffer) throws NulsException { List<Script> scripts = new ArrayList<>(); while (!byteBuffer.isFinished()) { scripts.add(new Script(byteBuffer.readByLengthByte())); } this.scripts = scripts; }
public String readString() throws NulsException { try { byte[] bytes = this.readByLengthByte(); if (null == bytes) { return EMPTY; } return new String(bytes, NulsConfig.DEFAULT_ENCODING); } catch (UnsupportedEncodingException e) { Log.error(e); throw new NulsException(e); } }
@Override public void parse(NulsByteBuffer byteBuffer) throws NulsException { this.address = byteBuffer.readBytes(Address.ADDRESS_LENGTH); this.reasonCode = byteBuffer.readByte(); this.evidence = byteBuffer.readByLengthByte(); }
@Override public void parse(NulsByteBuffer byteBuffer) throws NulsException { byte[] bytes = byteBuffer.readBytes(Address.ADDRESS_LENGTH); this.address = Address.fromHashs(bytes); this.m = byteBuffer.readUint32(); this.pubKeyList = new ArrayList<>(); long count = byteBuffer.readUint32(); for (int i = 0; i < count; i++) { pubKeyList.add(byteBuffer.readByLengthByte()); } }
@Override public void parse(NulsByteBuffer byteBuffer) throws NulsException { type = byteBuffer.readUint16(); time = byteBuffer.readUint48(); this.remark = byteBuffer.readByLengthByte(); txData = this.parseTxData(byteBuffer); this.coinData = byteBuffer.readNulsData(new CoinData()); /*try { hash = NulsDigestData.calcDigestData(this.serializeForHash()); } catch (IOException e) { Log.error(e); }*/ transactionSignature = byteBuffer.readByLengthByte(); }
@Override public void parse(NulsByteBuffer byteBuffer) throws NulsException { this.owner = byteBuffer.readByLengthByte(); this.na = Na.valueOf(byteBuffer.readInt64()); this.lockTime = byteBuffer.readUint48(); }
@Override public void parse(NulsByteBuffer byteBuffer) throws NulsException { this.blockHeight=byteBuffer.readInt64(); this.hash=new NulsDigestData( byteBuffer.readByte(),byteBuffer.readByLengthByte()); this.preHash=new NulsDigestData( byteBuffer.readByte(),byteBuffer.readByLengthByte()); int listCount = (int) byteBuffer.readVarInt(); if (0 < listCount) { List<UtxoAccountsBalancePo> list = new ArrayList<>(); for (int i = 0; i < listCount; i++) { list.add(byteBuffer.readNulsData(new UtxoAccountsBalancePo())); } this.balanceList = list; } }
@Override public void parse(NulsByteBuffer byteBuffer) throws NulsException { this.preHash = byteBuffer.readHash(); this.merkleHash = byteBuffer.readHash(); this.time = byteBuffer.readVarInt(); this.height = byteBuffer.readVarInt(); this.txCount = byteBuffer.readVarInt(); this.extend = byteBuffer.readByLengthByte(); this.scriptSign = byteBuffer.readNulsData(new BlockSignature()); this.txHashList = new ArrayList<>(); for (int i = 0; i < txCount; i++) { this.txHashList.add(byteBuffer.readHash()); } if (!byteBuffer.isFinished()) { this.stateRoot = byteBuffer.readByLengthByte(); } }
@Override public void parse(NulsByteBuffer byteBuffer) throws NulsException { this.owner = byteBuffer.readByLengthByte(); this.balance = Na.valueOf(byteBuffer.readInt64()); this.hadLocked = Na.valueOf(byteBuffer.readInt64()); } }
@Override public void parse(NulsByteBuffer byteBuffer) throws NulsException { this.txHash = byteBuffer.readHash(); this.blockHeight = byteBuffer.readUint32(); this.time = byteBuffer.readUint48(); this.addresses = byteBuffer.readByLengthByte(); this.txType = byteBuffer.readUint16(); this.status = byteBuffer.readByte(); }
@Override public void parse(NulsByteBuffer byteBuffer) throws NulsException { this.txHash = byteBuffer.readHash(); this.blockHeight = byteBuffer.readUint32(); this.time = byteBuffer.readUint48(); this.addresses = byteBuffer.readByLengthByte(); this.txType = byteBuffer.readUint16(); this.status = byteBuffer.readByte(); }
@Override public void parse(NulsByteBuffer byteBuffer) throws NulsException { this.type = byteBuffer.readByte(); this.address = byteBuffer.readBytes(Address.ADDRESS_LENGTH); this.time = byteBuffer.readUint48(); this.height = byteBuffer.readVarInt(); this.roundIndex = byteBuffer.readVarInt(); this.reasonCode = byteBuffer.readShort(); this.evidence = byteBuffer.readByLengthByte(); }
@Override public void parse(NulsByteBuffer byteBuffer) throws NulsException { this.roundIndex = byteBuffer.readUint32(); this.consensusMemberCount = byteBuffer.readUint16(); this.roundStartTime = byteBuffer.readUint48(); this.packingIndexOfRound = byteBuffer.readUint16(); if (!byteBuffer.isFinished()) { this.mainVersion = byteBuffer.readInt32(); this.currentVersion = byteBuffer.readInt32(); this.percent = byteBuffer.readUint16(); this.delay = byteBuffer.readUint32(); this.stateRoot = byteBuffer.readByLengthByte(); } }
@Override public void parse(NulsByteBuffer byteBuffer) throws NulsException { this.preHash = byteBuffer.readHash(); this.merkleHash = byteBuffer.readHash(); this.time = byteBuffer.readUint48(); this.height = byteBuffer.readUint32(); this.txCount = byteBuffer.readUint32(); this.extend = byteBuffer.readByLengthByte(); try { this.hash = NulsDigestData.calcDigestData(this.serialize()); } catch (IOException e) { Log.error(e); } this.blockSignature = byteBuffer.readNulsData(new BlockSignature()); // } }
@Override public void parse(NulsByteBuffer byteBuffer) throws NulsException { this.sender = byteBuffer.readBytes(Address.ADDRESS_LENGTH); this.contractAddress = byteBuffer.readBytes(Address.ADDRESS_LENGTH); this.value = byteBuffer.readInt64(); this.codeLen = byteBuffer.readInt32(); this.code = byteBuffer.readByLengthByte(); this.gasLimit = byteBuffer.readInt64(); this.price = byteBuffer.readInt64(); this.argsCount = byteBuffer.readByte(); byte length = this.argsCount; this.args = new String[length][]; for(byte i = 0; i < length; i++) { byte argCount = byteBuffer.readByte(); if(argCount == 0) { args[i] = new String[0]; } else { String[] arg = new String[argCount]; for(byte k = 0; k < argCount; k++) { arg[k] = byteBuffer.readString(); } args[i] = arg; } } }