class ByteBuffer {

    @Override
    public boolean equals(Object obj)  {
        if (this == obj) {
            return true;
        }
        if ((obj == null) || !(obj instanceof ByteBuffer)) {
            return false;
        }
        ByteBuffer toTest = (ByteBuffer)obj;

        // can't be equal if size()'s don't match
        if (toTest.size() != this.size())
            return false;

        // start comparison
        int length = this.size();
        for (int i = 0; i < length; i++) {
            try {
                if (this.get(i) != toTest.get(i)) {
                    return false;
                }
            } catch (Exception e) {
                logger.error("Impossible case should never happen", e);
                return false;
            }
        }
        
        return true;
    }

    public  ByteBuffer();
    public  ByteBuffer(int capacity);
    public  ByteBuffer(byte[] bytes);
    public  ByteBuffer(byte[] bytes, int capacity);
    public  ByteBuffer(byte[] bytes, int offset, int length);
    public  ByteBuffer(byte[] bytes, int offset, int length, int capacity);
    public  ByteBuffer(String string0);
    public  ByteBuffer(String string0, int capacity);

}