class BSN extends BasePacket {

    @Override
    public byte[] serialize() {
    	short length = 4 /* magic */ + 2 /* type */ + 2 /* version */;
    	
    	byte[] payloadData = null;
    	if (this.payload != null) {
            payload.setParent(this);
            payloadData = payload.serialize();
            length += payloadData.length;
        }
    
        byte[] data = new byte[length];
        ByteBuffer bb = ByteBuffer.wrap(data);
        bb.putInt(BSN_MAGIC);
        bb.putShort(this.type);
        bb.putShort(this.version);
        if (payloadData != null)
        	bb.put(payloadData);

        if (this.parent != null && this.parent instanceof Ethernet)
            ((Ethernet)this.parent).setEtherType(Ethernet.TYPE_BSN);

        return data;
    }

    public  BSN();
    public  BSN(short type);

}