本文整理汇总了Java中org.ethereum.vm.program.Memory.readWord方法的典型用法代码示例。如果您正苦于以下问题:Java Memory.readWord方法的具体用法?Java Memory.readWord怎么用?Java Memory.readWord使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.ethereum.vm.program.Memory
的用法示例。
在下文中一共展示了Memory.readWord方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: memoryLoad_1
import org.ethereum.vm.program.Memory; //导入方法依赖的package包/类
@Test
public void memoryLoad_1() {
Memory memoryBuffer = new Memory();
DataWord value = memoryBuffer.readWord(100);
assertTrue(value.intValue() == 0);
assertTrue(memoryBuffer.getChunks().size() == 1);
assertTrue(memoryBuffer.size() == 32 * 5);
}
示例2: memoryLoad_2
import org.ethereum.vm.program.Memory; //导入方法依赖的package包/类
@Test
public void memoryLoad_2() {
Memory memoryBuffer = new Memory();
DataWord value = memoryBuffer.readWord(2015);
assertTrue(value.intValue() == 0);
assertTrue(memoryBuffer.getChunks().size() == 2);
assertTrue(memoryBuffer.size() == 2048);
}
示例3: memoryLoad_3
import org.ethereum.vm.program.Memory; //导入方法依赖的package包/类
@Test
public void memoryLoad_3() {
Memory memoryBuffer = new Memory();
DataWord value = memoryBuffer.readWord(2016);
assertTrue(value.intValue() == 0);
assertTrue(memoryBuffer.getChunks().size() == 2);
assertTrue(memoryBuffer.size() == 2048);
}
示例4: memoryLoad_4
import org.ethereum.vm.program.Memory; //导入方法依赖的package包/类
@Test
public void memoryLoad_4() {
Memory memoryBuffer = new Memory();
DataWord value = memoryBuffer.readWord(2017);
assertTrue(value.intValue() == 0);
assertTrue(memoryBuffer.getChunks().size() == 3);
assertTrue(memoryBuffer.size() == 2080);
}
示例5: memoryLoad_5
import org.ethereum.vm.program.Memory; //导入方法依赖的package包/类
@Test
public void memoryLoad_5() {
Memory memoryBuffer = new Memory();
byte[] data1 = new byte[1024];
Arrays.fill(data1, (byte) 1);
byte[] data2 = new byte[1024];
Arrays.fill(data2, (byte) 2);
memoryBuffer.write(0, data1, data1.length, false);
memoryBuffer.write(1024, data2, data2.length, false);
assertTrue(memoryBuffer.getChunks().size() == 2);
assertTrue(memoryBuffer.size() == 2048);
DataWord val1 = memoryBuffer.readWord(0x3df);
DataWord val2 = memoryBuffer.readWord(0x3e0);
DataWord val3 = memoryBuffer.readWord(0x3e1);
assertArrayEquals(
Hex.decode("0101010101010101010101010101010101010101010101010101010101010101"),
val1.getData());
assertArrayEquals(
Hex.decode("0101010101010101010101010101010101010101010101010101010101010101"),
val2.getData());
assertArrayEquals(
Hex.decode("0101010101010101010101010101010101010101010101010101010101010102"),
val3.getData());
assertTrue(memoryBuffer.size() == 2048);
}