Code example for ByteBuffer

Methods: putInt, putShort

0
        this.queueId = data.getInt();
    } 
 
    @Override 
    public void writeTo(ByteBuffer data) {
        data.putShort(this.portNumber);
        data.putShort((short) 0); // pad
        data.putInt(this.queueId);
    } 
 
    @Override 
    public int hashCode() { 
        final int prime = 443;
        int result = 1;
        result = prime * result + portNumber;
        result = prime * result + queueId;
        return result;
    } 
 
    @Override 
    public boolean equals(Object obj) {