I have a simple Java class:
import java.io.Serializable;
public class SimpleClass implements Serializable {
private static final long serialVersionUID = -9062339996046009959L;
public byte Byte;
public int id;
public SimpleClass(byte Byte, int id) {
this.Byte = Byte;
this.id = id;
}
}
Since a int is 4 bytes, and a byte is well a byte, shouldn't this class require 5 bytes?
But when I serialize it and find the length of the byte array I get 59,
Why does this occur?
Also I am using this to convert my object into a byte array.