NefFile extends NeoSerializable { @Override public int getSize() { return HEADER_SIZE + IOUtils.getVarSize(this.script); } NefFile();  NefFile(String compiler, Version version, byte[] script); String getCompiler(); Version getVersion(); ScriptHash getScriptHash(); byte[] getCheckSum(); byte[] getScript(); @Override int getSize(); @Override void serialize(BinaryWriter writer); @Override void deserialize(BinaryReader reader); static byte[] computeChecksum(NefFile file); static NefFile readFromFile(File nefFile); public ScriptHash scriptHash; public byte[] checkSum; public byte[] script; }
@Test public void getSize() throws DeserializationException { byte[] nefBytes = Numeric.hexStringToByteArray(referenceNef); NefFile nef = NeoSerializableInterface.from(nefBytes, NefFile.class); assertThat(nef.getSize(), is(110)); }
@Test public void getVersionSize() { assertThat(new NefFile.Version().getSize(), is(4 * 32)); }