private static final Object[] decodeInteger(byte[] bencoded_bytes, int offset) throws BencodingException
    {
        StringBuffer int_chars = new StringBuffer();
        offset++;
        for(; bencoded_bytes[offset] != (byte)'e' && bencoded_bytes.length > (offset); offset++)
        {
            if((bencoded_bytes[offset] < 48 || bencoded_bytes[offset] > 57) && bencoded_bytes[offset] != 45)
                throw new BencodingException("Expected an ASCII integer character, found " + (int)bencoded_bytes[offset]);
            int_chars.append((char)bencoded_bytes[offset]);
        }
        try 
        {
            offset++;   // Skip the 'e'
            return new Object[] {new Integer(offset),new Integer(Integer.parseInt(int_chars.toString()))};
        }
        catch(NumberFormatException nfe)
        {
            throw new BencodingException("Could not parse integer at position" + offset + ".\nInvalid character at position " + offset + ".");
        }
    }