private static function decodeDouble($length, &$bytes)
    {
        // Not enough bytes
        if ($length > count($bytes))
        {
            throw new CborException("The supplied byte string is too short to decode the specified double type.");
        }

        // Grab the required number of bytes
        $byteArray = array_splice($bytes, 0, $length);

        // Unpack a 32 bit double
        if ($length == 4)
        {
            return Float32::decode($byteArray);
        }

        // Unpack a 64 bit double
        else if ($length == 8)
        {
            return Float64::decode($byteArray);
        }

        // Unpack a 16 bit double
        else
        {
            return Float16::decode($byteArray);
        }
    }