Code example for ByteBuffer

Methods: getInt, getShort

0
        return this;
    } 
 
    @Override 
    public void readFrom(ByteBuffer data) {
        super.readFrom(data);
        this.rate = data.getShort();
        data.getInt(); // pad
        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() {