test for removing extra jumps (currently fails), small issue with ActionEnd fixed

This commit is contained in:
Honfika
2013-10-12 12:49:06 +02:00
parent 34d99be471
commit ac7f4a6f17
7 changed files with 164 additions and 31 deletions
@@ -352,13 +352,15 @@ public class Action implements GraphSourceItem {
*/
public static byte[] actionsToBytes(List<Action> list, boolean addZero, int version) {
ByteArrayOutputStream baos = new ByteArrayOutputStream();
Action lastAction = null;
for (Action a : list) {
try {
lastAction = a;
baos.write(a.getBytes(version));
} catch (IOException e) {
}
}
if (addZero) {
if (addZero && (lastAction == null || !(lastAction instanceof ActionEnd))) {
baos.write(0);
}
return baos.toByteArray();