Code example for ByteBuffer

Methods: putInt, putShort

0
        data.getShort(); // pad
    } 
 
    @Override 
    public void writeTo(ByteBuffer data) {
        super.writeTo(data);
        data.putShort(this.rate);
        data.putInt(0); // pad
        data.putShort((short) 0); // pad
    } 
 
    @Override 
    public int hashCode() { 
        final int prime = 3259;
        int result = super.hashCode();
        result = prime * result + rate;
        return result;
    } 
 
    @Override 
    public boolean equals(Object obj) {